diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-11 21:33:31 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-11 21:33:31 +0000 |
commit | 4c081a041f493fca68d9a511f7d747ae643e486c (patch) | |
tree | 4a3f5fc3a995cf3d878c168a98209d3b82043072 /testsuites/samples | |
parent | 2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-4c081a041f493fca68d9a511f7d747ae643e486c.tar.bz2 |
2007-12-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* fileio/init.c: Add RTEMS Shell configuration and static configuration
of user commands.
Diffstat (limited to 'testsuites/samples')
-rw-r--r-- | testsuites/samples/ChangeLog | 5 | ||||
-rw-r--r-- | testsuites/samples/fileio/init.c | 36 |
2 files changed, 41 insertions, 0 deletions
diff --git a/testsuites/samples/ChangeLog b/testsuites/samples/ChangeLog index 765a24dabc..9dba31fd97 100644 --- a/testsuites/samples/ChangeLog +++ b/testsuites/samples/ChangeLog @@ -1,3 +1,8 @@ +2007-12-11 Joel Sherrill <joel.sherrill@oarcorp.com> + + * fileio/init.c: Add RTEMS Shell configuration and static configuration + of user commands. + 2007-11-29 Chris Johns <chrisj@rtems.org> * iostream/Makefile.am: Change the executable name so it does not diff --git a/testsuites/samples/fileio/init.c b/testsuites/samples/fileio/init.c index a62e3b0faf..b33424db20 100644 --- a/testsuites/samples/fileio/init.c +++ b/testsuites/samples/fileio/init.c @@ -602,3 +602,39 @@ Init (rtems_task_argument ignored) fileio_menu(); } + +/* + * RTEMS Shell Configuration -- Add a command and an alias for it + */ + +int main_usercmd(int argc, char **argv) +{ + int i; + printf( "UserCommand: argc=%d\n", argc ); + for (i=0 ; i<argc ; i++ ) + printf( "argv[%d]= %s\n", i, argv[i] ); + return 0; +} + +shell_cmd_t Shell_USERCMD_Command = { + "usercmd", /* name */ + "usercmd n1 [n2 [n3...]] # echo arguments", /* usage */ + "user", /* topic */ + main_usercmd, /* command */ + NULL, /* alias */ + NULL /* next */ +}; + +shell_alias_t Shell_USERECHO_Alias = { + "usercmd", /* command */ + "userecho" /* alias */ +}; + + +#define CONFIGURE_SHELL_USER_COMMANDS &Shell_USERCMD_Command +#define CONFIGURE_SHELL_USER_ALIASES &Shell_USERECHO_Alias +#define CONFIGURE_SHELL_COMMANDS_INIT +#define CONFIGURE_SHELL_COMMANDS_ALL + +#include <rtems/shellconfig.h> + |