global options in help output

Thomas Arendsen Hein thomas at intevation.de
Thu Aug 25 12:11:32 CDT 2005


* TK Soh <teekaysoh at yahoo.com> [20050825 02:32]:
> The global options in help output seemed a bit cluttered to me. This patch
> might make it easier for our eyes.
>
> # HG changeset patch
> # User TK Soh <tksoh at freescale.com>
> # Node ID 7c8ba35ab54cefeb7898a3be85d64780514ce77e
> # Parent  836667830fee3fba9afb4efe315b531d9c773d86
> help: show global options in alphabetical order.

It is, but sorting it alphabetically isn't the right thing to do.

Included here and pullable from
http://hg.intevation.org/mercurial/tah
is a sorting by topic.

Thomas

# HG changeset patch
# User Thomas Arendsen Hein <thomas at intevation.de>
# Node ID 772507daaa17aa11b7891ff02a1bdd1a19408f47
# Parent  b35d5b86e2409f5b3c33798aca475b523cc1e81c
Sort global options by topic: directories, ui, timing, other
(and changed indentation to match command table)

diff -r b35d5b86e2409f5b3c33798aca475b523cc1e81c -r 772507daaa17aa11b7891ff02a1bdd1a19408f47 mercurial/commands.py
--- a/mercurial/commands.py	Thu Aug 25 16:25:19 2005
+++ b/mercurial/commands.py	Thu Aug 25 16:35:35 2005
@@ -1510,19 +1510,20 @@
          'hg update [-b TAG] [-m] [-C] [REV]'),
     "verify": (verify, [], 'hg verify'),
     "version": (show_version, [], 'hg version'),
-    }
-
-globalopts = [('v', 'verbose', None, 'verbose mode'),
-              ('', 'debug', None, 'debug mode'),
-              ('q', 'quiet', None, 'quiet mode'),
-              ('', 'profile', None, 'profile'),
-              ('', 'cwd', '', 'change working directory'),
-              ('R', 'repository', "", 'repository root directory'),
-              ('', 'traceback', None, 'print traceback on exception'),
-              ('y', 'noninteractive', None, 'run non-interactively'),
-              ('', 'version', None, 'output version information and exit'),
-              ('', 'time', None, 'time how long the command takes'),
-             ]
+}
+
+globalopts = [
+    ('R', 'repository', "", 'repository root directory'),
+    ('', 'cwd', '', 'change working directory'),
+    ('y', 'noninteractive', None, 'run non-interactively'),
+    ('q', 'quiet', None, 'quiet mode'),
+    ('v', 'verbose', None, 'verbose mode'),
+    ('', 'debug', None, 'debug mode'),
+    ('', 'traceback', None, 'print traceback on exception'),
+    ('', 'time', None, 'time how long the command takes'),
+    ('', 'profile', None, 'profile'),
+    ('', 'version', None, 'output version information and exit'),
+]
 
 norepo = "clone init version help debugconfig debugdata" + \
          " debugindex debugindexdot paths"

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/


More information about the Mercurial mailing list