2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
23 struct cmd_syndesc *as;
25 printf("in the apple command\n");
32 struct cmd_syndesc *as;
34 register struct cmd_item *ti;
35 printf("in the pear command\n");
36 printf("number is %s\n", as->parms[0].items->data);
37 if (as->parms[1].items)
38 printf("running unauthenticated\n");
39 for (ti = as->parms[2].items; ti; ti = ti->next) {
40 printf("spotspos %s\n", ti->data);
42 if (as->parms[8].items)
43 printf("cell name %s\n", as->parms[8].items->data);
50 struct cmd_syndesc *as;
59 register struct cmd_syndesc *ts;
66 initialize_CMD_error_table();
68 ts = cmd_CreateSyntax("apple", cproc1, NULL, "describe apple");
70 ts = cmd_CreateSyntax("pear", cproc2, NULL, "describe pear");
71 cmd_AddParm(ts, "-num", CMD_LIST, 0, "number of pears");
72 cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");
73 cmd_AddParm(ts, "-spotpos", CMD_LIST, CMD_OPTIONAL | CMD_EXPANDS, 0);
75 cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
76 cmd_CreateAlias(ts, "alias");
78 ts = cmd_CreateSyntax("quit", cproc3, 0, "quit");
85 code = cmd_ParseLine(tline, tv, &tc, 100);
87 printf("itest: parsing failure: %s\n", afs_error_message(code));
90 code = cmd_Dispatch(tc, tv);
93 printf("itest: execution failed: %s\n", afs_error_message(code));