changeset 30:327984ce004e

cvsps (ui): simplify usage output (remove lines of code), add -V option.
author ng0@n0.is
date Fri, 03 May 2019 13:32:24 +0000
parents 663073775cbd
children ab892a11fb92
files cvsps.c
diffstat 1 files changed, 15 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/cvsps.c	Fri May 03 13:21:48 2019 +0000
+++ b/cvsps.c	Fri May 03 13:32:24 2019 +0000
@@ -657,95 +657,15 @@
         if (str1)
                 debug (DEBUG_APPERROR, "\nbad usage: %s %s\n", str1, str2);
 
-        debug (
-          DEBUG_APPERROR,
-          "Usage: cvsps [-h] [-x] [-u] [-z <fuzz>] [-g] [-s <range>[,<range>]]  ");
         debug (DEBUG_APPERROR,
-               "             [-a <author>] [-f <file>] [-d <date1> [-d <date2>]] ");
-        debug (DEBUG_APPERROR,
-               "             [-b <branch>]  [-l <regex>] [-r <tag> [-r <tag>]] ");
-        debug (
-          DEBUG_APPERROR,
-          "             [-p <directory>] [-v] [-t] [--norc] [--summary-first]");
-        debug (DEBUG_APPERROR,
-               "             [--test-log <captured cvs log file>] [--bkcvs]");
-        debug (
-          DEBUG_APPERROR,
-          "             [--no-rlog] [--diff-opts <option string>] [--cvs-direct]");
-        debug (
-          DEBUG_APPERROR,
-          "             [--debuglvl <bitmask>] [-Z <compression>] [--root <cvsroot>]");
-        debug (DEBUG_APPERROR, "             [-q] [-A] [<repository>]");
-        debug (DEBUG_APPERROR, "");
-        debug (DEBUG_APPERROR, "Where:");
-        debug (DEBUG_APPERROR, "  -h display this informative message");
-        debug (DEBUG_APPERROR, "  -x ignore (and rebuild) cvsps.cache file");
-        debug (DEBUG_APPERROR, "  -u update cvsps.cache file");
-        debug (
-          DEBUG_APPERROR,
-          "  -z <fuzz> set the timestamp fuzz factor for identifying patch sets");
-        debug (DEBUG_APPERROR,
-               "  -g generate diffs of the selected patch sets");
-        debug (
-          DEBUG_APPERROR,
-          "  -s <patch set>[-[<patch set>]][,<patch set>...] restrict patch sets by id");
-        debug (DEBUG_APPERROR,
-               "  -a <author> restrict output to patch sets created by author");
-        debug (DEBUG_APPERROR,
-               "  -f <file> restrict output to patch sets involving file");
-        debug (DEBUG_APPERROR,
-               "  -d <date1> -d <date2> if just one date specified, show");
-        debug (DEBUG_APPERROR,
-               "     revisions newer than date1.  If two dates specified,");
-        debug (DEBUG_APPERROR, "     show revisions between two dates.");
-        debug (
-          DEBUG_APPERROR,
-          "  -b <branch> restrict output to patch sets affecting history of branch");
-        debug (
-          DEBUG_APPERROR,
-          "  -l <regex> restrict output to patch sets matching <regex> in log message");
-        debug (DEBUG_APPERROR,
-               "  -r <tag1> -r <tag2> if just one tag specified, show");
-        debug (DEBUG_APPERROR,
-               "     revisions since tag1. If two tags specified, show");
-        debug (DEBUG_APPERROR, "     revisions between the two tags.");
-        debug (
-          DEBUG_APPERROR,
-          "  -p <directory> output patch sets to individual files in <directory>");
-        debug (DEBUG_APPERROR, "  -v show very verbose parsing messages");
-        debug (DEBUG_APPERROR, "  -t show some brief memory usage statistics");
-        debug (DEBUG_APPERROR,
-               "  --norc when invoking cvs, ignore the .cvsrc file");
-        debug (
-          DEBUG_APPERROR,
-          "  --summary-first when multiple patch sets are shown, put all summaries first");
-        debug (
-          DEBUG_APPERROR,
-          "  --test-log <captured cvs log> supply a captured cvs log for testing");
-        debug (
-          DEBUG_APPERROR,
-          "  --diff-opts <option string> supply special set of options to diff");
-        debug (DEBUG_APPERROR,
-               "  --bkcvs special hack for parsing the BK -> CVS log format");
-        debug (DEBUG_APPERROR,
-               "  --no-rlog disable rlog (it's faulty in some setups)");
-        debug (
-          DEBUG_APPERROR,
-          "  --cvs-direct (--no-cvs-direct) enable (disable) built-in cvs client code");
-        debug (DEBUG_APPERROR,
-               "  --debuglvl <bitmask> enable various debug channels.");
-        debug (
-          DEBUG_APPERROR,
-          "  -Z <compression> A value 1-9 which specifies amount of compression");
-        debug (
-          DEBUG_APPERROR,
-          "  --root <cvsroot> specify cvsroot.  overrides env. and working directory (cvs-direct only)");
-        debug (DEBUG_APPERROR, "  -q be quiet about warnings");
-        debug (DEBUG_APPERROR, "  -A track and report branch ancestry");
-        debug (
-          DEBUG_APPERROR,
-          "  <repository> apply cvsps to repository.  overrides working directory");
-        debug (DEBUG_APPERROR, "\ncvsps version %s\n", VERSION);
+               "Usage: cvsps [-ghqtuvxA] [-z <fuzz>] [-s <range>[,<range>]] "
+               "[-a <author>] [-f <file>] [-d <date1> [-d <date2>]] "
+               "[-b <branch>]  [-l <regex>] [-r <tag> [-r <tag>]] "
+               "[-p <directory>] [--norc] [--summary-first] "
+               "[--test-log <captured cvs log file>] [--bkcvs] "
+               "[--no-rlog] [--diff-opts <option string>] [--cvs-direct] "
+               "[--debuglvl <bitmask>] [-Z <compression>] [--root <cvsroot>] "
+               "[<repository>]");
 
         return -1;
 }
@@ -765,6 +685,13 @@
                         continue;
                 }
 
+                if (0 == strcmp (argv[i], "-V"))
+                {
+                        /* FIXME: bad printf. */
+                        printf ("cvsps version %s\n", VERSION);
+                        exit (0);
+                }
+
                 if (strcmp (argv[i], "-g") == 0)
                 {
                         do_diff = 1;