#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header$");
+RCSID
+ ("$Header$");
#include "cmd.h"
#include <stdio.h>
#include <com_err.h>
-static cproc1 (as, arock)
-char *arock;
-struct cmd_syndesc *as; {
+static
+cproc1(as, arock)
+ char *arock;
+ struct cmd_syndesc *as;
+{
printf("in the apple command\n");
return 0;
}
-static cproc2 (as, arock)
-char *arock;
-struct cmd_syndesc *as; {
+static
+cproc2(as, arock)
+ char *arock;
+ struct cmd_syndesc *as;
+{
register struct cmd_item *ti;
printf("in the pear command\n");
printf("number is %s\n", as->parms[0].items->data);
- if (as->parms[1].items) printf("running unauthenticated\n");
- for(ti=as->parms[2].items; ti; ti=ti->next) {
+ if (as->parms[1].items)
+ printf("running unauthenticated\n");
+ for (ti = as->parms[2].items; ti; ti = ti->next) {
printf("spotspos %s\n", ti->data);
}
if (as->parms[8].items)
return 0;
}
-static void cproc3(as, arock)
-char *arock;
-struct cmd_syndesc *as; {
+static void
+cproc3(as, arock)
+ char *arock;
+ struct cmd_syndesc *as;
+{
exit(0);
}
main(argc, argv)
-int argc;
-char **argv; {
+ int argc;
+ char **argv;
+{
register struct cmd_syndesc *ts;
char tline[1000];
long tc;
char *tp;
long code;
char *tv[100];
-
+
initialize_CMD_error_table();
ts = cmd_CreateSyntax("apple", cproc1, NULL, "describe apple");
cmd_Seek(ts, 8);
cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
cmd_CreateAlias(ts, "alias");
-
+
ts = cmd_CreateSyntax("quit", cproc3, 0, "quit");
-
+
while (1) {
printf("> ");
tp = gets(tline);
- if (tp == NULL) break;
+ if (tp == NULL)
+ break;
code = cmd_ParseLine(tline, tv, &tc, 100);
if (code) {
printf("itest: parsing failure: %s\n", error_message(code));