chiark / gitweb /
chkpath.c, tmpdir.c, chpath.1, tmpdir.1: Sort lists of options.
[checkpath] / chkpath.c
index babf6135e3fac9ffd643193b542d6b5c4f16f7ea..e118c9ea84479c1d4fb0c8fd8683cc73d2643210 100644 (file)
--- a/chkpath.c
+++ b/chkpath.c
@@ -57,7 +57,7 @@ static void report(unsigned what, int verbose,
 /* --- @usage@ --- */
 
 static void usage(FILE *fp)
-  { fprintf(fp, "Usage: %s [-vqstp] [-g NAME] [PATH...]\n", QUIS); }
+  { fprintf(fp, "Usage: %s [-pqstv] [-g NAME] [PATH...]\n", QUIS); }
 
 /* --- @version@ --- */
 
@@ -83,13 +83,13 @@ Options provided are:\n\
 -V, --version          Display the program's version number.\n\
 -u, --usage            Show a terse usage summary.\n\
 \n\
--v, --verbose          Be verbose about the search progress (cumulative).\n\
+-g, --group NAME       Consider members of group NAME trustworthy.\n\
+-p, --print            Write the secure path elements to standard output.\n\
 -q, --quiet            Be quiet about the search progress (cumulative).\n\
 -s, --sticky           Consider sticky directories secure against\n\
                        modification by world and group (not recommended).\n\
 -t, --trust-group      Consider other members of your group trustworthy.\n\
--g, --group NAME       Consider members of group NAME trustworthy.\n\
--p, --print            Write the secure path elements to standard output.\n\
+-v, --verbose          Be verbose about the search progress (cumulative).\n\
 ",
        fp);
 }
@@ -126,14 +126,14 @@ int main(int argc, char *argv[])
       { "version",     0,              0,      'V' },
       { "usage",       0,              0,      'u' },
       { "group",       OPTF_ARGREQ,    0,      'g' },
-      { "verbose",     0,              0,      'v' },
+      { "print",       0,              0,      'p' },
       { "quiet",       0,              0,      'q' },
       { "sticky",      0,              0,      's' },
       { "trust-group", 0,              0,      't' },
-      { "print",       0,              0,      'p' },
+      { "verbose",     0,              0,      'v' },
       { 0,             0,              0,      0 }
     };
-    int i = mdwopt(argc, argv, "hVu" "vqstpg:", opts, 0, 0, 0);
+    int i = mdwopt(argc, argv, "hVu" "g:pqstv", opts, 0, 0, 0);
 
     if (i < 0)
       break;
@@ -147,8 +147,11 @@ int main(int argc, char *argv[])
       case 'u':
        usage(stdout);
        exit(0);
-      case 'v':
-       cp.cp_verbose++;
+      case 'g':
+       allowgroup(&cp, optarg);
+       break;
+      case 'p':
+       f |= f_print;
        break;
       case 'q':
        if (cp.cp_verbose)
@@ -161,11 +164,8 @@ int main(int argc, char *argv[])
        if (checkpath_setgid(&cp) || checkpath_setgroups(&cp))
          die(1, "too many groups");
        break;
-      case 'g':
-       allowgroup(&cp, optarg);
-       break;
-      case 'p':
-       f |= f_print;
+      case 'v':
+       cp.cp_verbose++;
        break;
       default:
        bad = 1;