include-afsconfig-before-param-h-20010712
[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("$Header$");
14
15 #include "cmd.h"
16 #include <stdio.h>
17
18 static cproc (as, arock)
19 char *arock;
20 struct cmd_syndesc *as; {
21     register struct cmd_item *ti;
22     printf("in the pear command\n");
23     printf("number is %s\n", as->parms[0].items->data);
24     if (as->parms[1].items) printf("running unauthenticated\n");
25     for(ti=as->parms[2].items; ti; ti=ti->next) {
26         printf("spotspos %s\n", ti->data);
27     }
28     return 0;
29 }
30
31 main(argc, argv)
32 int argc;
33 char **argv; {
34     register struct cmd_syndesc *ts;
35     
36     ts = cmd_CreateSyntax((char *) 0, cproc, (char *) 0, "describe pear");
37     cmd_AddParm(ts, "-num", CMD_SINGLE, 0, "number of pears");
38     cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");
39     cmd_AddParm(ts, "-spotpos", CMD_LIST, CMD_OPTIONAL, 0);
40     
41     return cmd_Dispatch(argc, argv);
42 }