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>
18 static cproc1 (as, arock)
20 struct cmd_syndesc *as; {
21 printf("in the apple command\n");
25 static cproc2 (as, arock)
27 struct cmd_syndesc *as; {
28 register struct cmd_item *ti;
29 printf("in the pear command\n");
30 printf("number is %s\n", as->parms[0].items->data);
31 if (as->parms[1].items) printf("running unauthenticated\n");
32 for(ti=as->parms[2].items; ti; ti=ti->next) {
33 printf("spotspos %s\n", ti->data);
35 if (as->parms[8].items)
36 printf("cell name %s\n", as->parms[8].items->data);
43 register struct cmd_syndesc *ts;
45 ts = cmd_CreateSyntax("apple", cproc1, (char *) 0, "describe apple");
46 cmd_CreateAlias(ts, "appl");
48 ts = cmd_CreateSyntax("pear", cproc2, (char *) 0, "describe pear");
49 cmd_AddParm(ts, "-num", CMD_LIST, 0, "number of pears");
50 cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");
51 cmd_AddParm(ts, "-spotpos", CMD_LIST, CMD_OPTIONAL | CMD_EXPANDS, 0);
53 cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
54 cmd_CreateAlias(ts, "alias");
56 return cmd_Dispatch(argc, argv);