tests: Make -flag the first parm in command-t
authorAndrew Deason <adeason@sinenomine.net>
Mon, 23 May 2011 22:04:20 +0000 (17:04 -0500)
committerDerrick Brashear <shadow@dementia.org>
Wed, 25 May 2011 19:47:55 +0000 (12:47 -0700)
Move the -flag parameter to be the first parameter, to test more of
the positional argument handling.

Change-Id: I637c58e8c76bfc23919f29a1c598084275426773
Reviewed-on: http://gerrit.openafs.org/4710
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

tests/cmd/command-t.c

index 725e84f..b576048 100644 (file)
@@ -35,9 +35,9 @@
 
 #include <tap/basic.h>
 
-#define FIRST_OFF   0
-#define SECOND_OFF  1
-#define FLAG_OFF    2
+#define FLAG_OFF    0
+#define FIRST_OFF   1
+#define SECOND_OFF  2
 #define FOURTH_OFF  4
 #define FIFTH_OFF   5
 #define PERHAPS_OFF 6
@@ -72,9 +72,9 @@ main(int argc, char **argv)
     initialize_CMD_error_table();
 
     opts = cmd_CreateSyntax(NULL, testproc, NULL, NULL);
+    cmd_AddParm(opts, "-flag", CMD_FLAG, CMD_OPTIONAL, "a flag");
     cmd_AddParm(opts, "-first", CMD_SINGLE, CMD_REQUIRED, "first option");
     cmd_AddParm(opts, "-second", CMD_LIST, CMD_OPTIONAL, "second option");
-    cmd_AddParm(opts, "-flag", CMD_FLAG, CMD_OPTIONAL, "a flag");
 
     /* A simple command line */
     code = cmd_ParseLine("-first foo -second bar -flag", tv, &tc, 100);