diff mercurial/commands.py @ 593:ca3c499e94c6

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-----
author mpm@selenic.com
date Sun, 03 Jul 2005 03:58:05 -0800
parents 74175ce83378
children 9a8daeff0ffa
line wrap: on
line diff
--- 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')],