96d42eaabaa0ae4d68f3037b73e4a9d6f0393c11
[openafs.git] / src / cmd / test / dtest.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 #include <afsconfig.h>
11 #include <afs/param.h>
12
13 RCSID
14     ("$Header$");
15
16 #include "cmd.h"
17 #include <stdio.h>
18
19 static
20 cproc(as, arock)
21      char *arock;
22      struct cmd_syndesc *as;
23 {
24     register struct cmd_item *ti;
25     printf("in the pear command\n");
26     printf("number is %s\n", as->parms[0].items->data);
27     if (as->parms[1].items)
28         printf("running unauthenticated\n");
29     for (ti = as->parms[2].items; ti; ti = ti->next) {
30         printf("spotspos %s\n", ti->data);
31     }
32     return 0;
33 }
34
35 main(argc, argv)
36      int argc;
37      char **argv;
38 {
39     register struct cmd_syndesc *ts;
40
41     ts = cmd_CreateSyntax(NULL, cproc, NULL, "describe pear");
42     cmd_AddParm(ts, "-num", CMD_SINGLE, 0, "number of pears");
43     cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");
44     cmd_AddParm(ts, "-spotpos", CMD_LIST, CMD_OPTIONAL, 0);
45
46     return cmd_Dispatch(argc, argv);
47 }