Shorten help
authormpm@selenic.com
Sun, 03 Jul 2005 03:58:05 -0800
changeset 593 ca3c499e94c6
parent 592 74175ce83378
child 594 0a2ffc5c906b
Shorten help -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Shorten help Basic commands are now marked with "^" in the table only basic commands are show in hg help by default copyright banner not displayed with help by default manifest hash: 7337678588354ca669a3b13d1fbb0ad893563947 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCx9LNywK+sNU5EO8RAokCAJ9ZK2sGEto9RLyukFX+n0nzHRoB9QCfU84I e+Evc2g91kSS92FPrIC+Hnw= =yUmt -----END PGP SIGNATURE-----
mercurial/commands.py
tests/test-help.out
--- a/mercurial/commands.py	Sun Jul 03 03:33:48 2005 -0800
+++ b/mercurial/commands.py	Sun Jul 03 03:58:05 2005 -0800
@@ -215,16 +215,22 @@
             ui.warn("hg: unknown command %s\n" % cmd)
         sys.exit(0)
     else:
-        if not ui.quiet:
+        if ui.verbose:
             show_version(ui)
             ui.write('\n')
-        ui.write('hg commands:\n\n')
+        if ui.verbose:
+            ui.write('hg commands:\n\n')
+        else:
+            ui.write('basic hg commands (use -v for long list):\n\n')
 
         h = {}
         for c, e in table.items():
             f = c.split("|")[0]
-            if f.startswith("debug"):
+            if not ui.verbose and not f.startswith("^"):
                 continue
+            if not ui.debugflag and f.startswith("debug"):
+                continue
+            f = f.lstrip("^")
             d = ""
             if e[0].__doc__:
                 d = e[0].__doc__.splitlines(0)[0].rstrip()
@@ -878,7 +884,7 @@
 # Command options and aliases are listed here, alphabetically
 
 table = {
-    "add": (add, [], "hg add [files]"),
+    "^add": (add, [], "hg add [files]"),
     "addremove": (addremove, [], "hg addremove [files]"),
     "annotate": (annotate,
                      [('r', 'revision', '', 'revision'),
@@ -887,9 +893,9 @@
                       ('c', 'changeset', None, 'show changeset')],
                      'hg annotate [-u] [-c] [-n] [-r id] [files]'),
     "cat": (cat, [], 'hg cat <file> [rev]'),
-    "clone": (clone, [('U', 'noupdate', None, 'skip update after cloning')],
+    "^clone": (clone, [('U', 'noupdate', None, 'skip update after cloning')],
               'hg clone [options] <source> [dest]'),
-    "commit|ci": (commit,
+    "^commit|ci": (commit,
                   [('t', 'text', "", 'commit text'),
                    ('A', 'addremove', None, 'run add/remove during commit'),
                    ('l', 'logfile', "", 'commit text file'),
@@ -901,7 +907,7 @@
     "debugdumpdirstate": (debugdumpdirstate, [], 'debugdumpdirstate'),
     "debugindex": (debugindex, [], 'debugindex <file>'),
     "debugindexdot": (debugindexdot, [], 'debugindexdot <file>'),
-    "diff": (diff, [('r', 'rev', [], 'revision')],
+    "^diff": (diff, [('r', 'rev', [], 'revision')],
              'hg diff [-r A] [-r B] [files]'),
     "export": (export, [('o', 'output', "", 'output to file')],
                "hg export [-o file] <changeset> ..."),
@@ -913,16 +919,16 @@
                      [('p', 'strip', 1, 'path strip'),
                       ('b', 'base', "", 'base path')],
                      "hg import [options] <patches>"),
-    "init": (init, [], 'hg init'),
-    "log|history": (log,
+    "^init": (init, [], 'hg init'),
+    "^log|history": (log,
                     [('r', 'rev', [], 'revision')],
                     'hg log [-r A] [-r B] [file]'),
     "manifest": (manifest, [], 'hg manifest [rev]'),
     "parents": (parents, [], 'hg parents [node]'),
-    "pull": (pull,
+    "^pull": (pull,
                   [('u', 'update', None, 'update working directory')],
                   'hg pull [options] [source]'),
-    "push": (push, [], 'hg push <destination>'),
+    "^push": (push, [], 'hg push <destination>'),
     "rawcommit": (rawcommit,
                   [('p', 'parent', [], 'parent'),
                    ('d', 'date', "", 'date code'),
@@ -932,18 +938,18 @@
                    ('l', 'logfile', "", 'commit text file')],
                   'hg rawcommit [options] [files]'),
     "recover": (recover, [], "hg recover"),
-    "remove|rm": (remove, [], "hg remove [files]"),
+    "^remove|rm": (remove, [], "hg remove [files]"),
     "revert": (revert,
                [("n", "nonrecursive", None, "don't recurse into subdirs"),
                 ("r", "rev", "", "revision")],
                "hg revert [files|dirs]"),
     "root": (root, [], "hg root"),
-    "serve": (serve, [('p', 'port', 8000, 'listen port'),
+    "^serve": (serve, [('p', 'port', 8000, 'listen port'),
                       ('a', 'address', '', 'interface address'),
                       ('n', 'name', os.getcwd(), 'repository name'),
                       ('t', 'templates', "", 'template map')],
               "hg serve [options]"),
-    "status": (status, [], 'hg status'),
+    "^status": (status, [], 'hg status'),
     "tag": (tag,  [('t', 'text', "", 'commit text'),
                    ('d', 'date', "", 'date code'),
                    ('u', 'user', "", 'user')],
@@ -951,7 +957,7 @@
     "tags": (tags, [], 'hg tags'),
     "tip": (tip, [], 'hg tip'),
     "undo": (undo, [], 'hg undo'),
-    "update|up|checkout|co":
+    "^update|up|checkout|co":
             (update,
              [('m', 'merge', None, 'allow merging of conflicts'),
               ('C', 'clean', None, 'overwrite locally modified files')],
--- a/tests/test-help.out	Sun Jul 03 03:33:48 2005 -0800
+++ b/tests/test-help.out	Sun Jul 03 03:58:05 2005 -0800
@@ -1,40 +1,18 @@
 + hg -q help
-hg commands:
+basic hg commands (use -v for long list):
 
- add         add the specified files on the next commit
- addremove   add all new files, delete all missing files
- annotate    show changeset information per file line
- cat         output the latest or given revision of a file
- clone       make a copy of an existing repository
- commit      commit the specified files or all outstanding changes
- copy        mark a file as copied or renamed for the next commit
- diff        diff working directory (or selected files)
- export      dump the header and diffs for one or more changesets
- forget      don't add the specified files on the next commit
- heads       show current repository heads
- help        show help for a given command or all commands
- identify    print information about the working copy
- import      import an ordered set of patches
- init        create a new repository in the current directory
- log         show the revision history of the repository or a single file
- manifest    output the latest or given revision of the project manifest
- parents     show the parents of the current working dir
- pull        pull changes from the specified source
- push        push changes to the specified destination
- rawcommit   raw commit interface
- recover     roll back an interrupted transaction
- remove      remove the specified files on the next commit
- revert      revert modified files or dirs back to their unmodified states
- root        print the root (top) of the current working dir
- serve       export the repository via HTTP
- status      show changed files in the working directory
- tag         add a tag for the current tip or a given revision
- tags        list repository tags
- tip         show the tip revision
- undo        undo the last transaction
- update      update or merge working directory
- verify      verify the integrity of the repository
- version     output version and copyright information
+ add      add the specified files on the next commit
+ clone    make a copy of an existing repository
+ commit   commit the specified files or all outstanding changes
+ diff     diff working directory (or selected files)
+ init     create a new repository in the current directory
+ log      show the revision history of the repository or a single file
+ pull     pull changes from the specified source
+ push     push changes to the specified destination
+ remove   remove the specified files on the next commit
+ serve    export the repository via HTTP
+ status   show changed files in the working directory
+ update   update or merge working directory
 + hg add -h
 hg add: option -h not recognized
 hg add [files]
@@ -51,40 +29,18 @@
 hg: unknown command foo
 + hg -q commands
 hg: unknown command 'commands'
-hg commands:
+basic hg commands (use -v for long list):
 
- add         add the specified files on the next commit
- addremove   add all new files, delete all missing files
- annotate    show changeset information per file line
- cat         output the latest or given revision of a file
- clone       make a copy of an existing repository
- commit      commit the specified files or all outstanding changes
- copy        mark a file as copied or renamed for the next commit
- diff        diff working directory (or selected files)
- export      dump the header and diffs for one or more changesets
- forget      don't add the specified files on the next commit
- heads       show current repository heads
- help        show help for a given command or all commands
- identify    print information about the working copy
- import      import an ordered set of patches
- init        create a new repository in the current directory
- log         show the revision history of the repository or a single file
- manifest    output the latest or given revision of the project manifest
- parents     show the parents of the current working dir
- pull        pull changes from the specified source
- push        push changes to the specified destination
- rawcommit   raw commit interface
- recover     roll back an interrupted transaction
- remove      remove the specified files on the next commit
- revert      revert modified files or dirs back to their unmodified states
- root        print the root (top) of the current working dir
- serve       export the repository via HTTP
- status      show changed files in the working directory
- tag         add a tag for the current tip or a given revision
- tags        list repository tags
- tip         show the tip revision
- undo        undo the last transaction
- update      update or merge working directory
- verify      verify the integrity of the repository
- version     output version and copyright information
+ add      add the specified files on the next commit
+ clone    make a copy of an existing repository
+ commit   commit the specified files or all outstanding changes
+ diff     diff working directory (or selected files)
+ init     create a new repository in the current directory
+ log      show the revision history of the repository or a single file
+ pull     pull changes from the specified source
+ push     push changes to the specified destination
+ remove   remove the specified files on the next commit
+ serve    export the repository via HTTP
+ status   show changed files in the working directory
+ update   update or merge working directory
 + exit 0