summaryrefslogtreecommitdiffstats
path: root/testsuites/samples/fileio/init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-11 21:33:31 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-11 21:33:31 +0000
commit4c081a041f493fca68d9a511f7d747ae643e486c (patch)
tree4a3f5fc3a995cf3d878c168a98209d3b82043072 /testsuites/samples/fileio/init.c
parent2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-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/fileio/init.c')
-rw-r--r--testsuites/samples/fileio/init.c36
1 files changed, 36 insertions, 0 deletions
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>
+