Rev 4107: (jamesw) Explicitly list aliases as commands that can be run in the in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Mar 10 09:55:20 GMT 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4107
revision-id: pqm at pqm.ubuntu.com-20090310095511-627bx4kwirxdx12y
parent: pqm at pqm.ubuntu.com-20090310090432-vcvk5yyhx3c6rfzv
parent: james.westby at canonical.com-20090310065654-ujpwv21yv1t5wf0v
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-03-10 09:55:11 +0000
message:
  (jamesw) Explicitly list aliases as commands that can be run in the
  	man page.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  tools/doc_generate/autodoc_man.py bzrman.py-20050601153041-0ff7f74de456d15e
    ------------------------------------------------------------
    revno: 4103.1.1
    revision-id: james.westby at canonical.com-20090310065654-ujpwv21yv1t5wf0v
    parent: pqm at pqm.ubuntu.com-20090310052823-5h4znt0j8j5ak38o
    parent: jw+debian at jameswestby.net-20090310063627-b43ad77refiog94l
    committer: James Westby <james.westby at canonical.com>
    branch nick: jamesw-integration
    timestamp: Tue 2009-03-10 16:56:54 +1000
    message:
      Explicitly list aliases as commands that can be run in the man page.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      tools/doc_generate/autodoc_man.py bzrman.py-20050601153041-0ff7f74de456d15e
    ------------------------------------------------------------
    revno: 4056.4.2
    revision-id: jw+debian at jameswestby.net-20090310063627-b43ad77refiog94l
    parent: jw+debian at jameswestby.net-20090303004909-kjgbarrmjk0zb1qt
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: bzr.dev
    timestamp: Tue 2009-03-10 16:36:27 +1000
    message:
      Tweaks from review by Ian.
    modified:
      tools/doc_generate/autodoc_man.py bzrman.py-20050601153041-0ff7f74de456d15e
    ------------------------------------------------------------
    revno: 4056.4.1
    revision-id: jw+debian at jameswestby.net-20090303004909-kjgbarrmjk0zb1qt
    parent: pqm at pqm.ubuntu.com-20090226073908-1fjp24b0llwqc0l7
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: bzr.dev
    timestamp: Tue 2009-03-03 00:49:09 +0000
    message:
      Explicitly list aliases in the manpage as commands that can be executed.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      tools/doc_generate/autodoc_man.py bzrman.py-20050601153041-0ff7f74de456d15e
=== modified file 'NEWS'
--- a/NEWS	2009-03-10 06:46:19 +0000
+++ b/NEWS	2009-03-10 09:55:11 +0000
@@ -153,6 +153,9 @@
     * The documentation for ``shelve`` and ``unshelve`` has been clarified.
       (Daniel Watkins, #327421, #327425)
 
+    * The generated manpage now explicitly lists aliases as commands.
+      (James Westby, #336998)
+
   API CHANGES:
 
     * ``bzr selftest`` now fails if the bazaar sources contain trailing

=== modified file 'tools/doc_generate/autodoc_man.py'
--- a/tools/doc_generate/autodoc_man.py	2008-09-16 12:15:51 +0000
+++ b/tools/doc_generate/autodoc_man.py	2009-03-10 06:36:27 +0000
@@ -92,11 +92,16 @@
 def getcommand_help(params):
     """Shows individual options for a bzr command"""
     output='.SH "COMMAND REFERENCE"\n'
+    formatted = {}
     for cmd_name in command_name_list():
         cmd_object = bzrlib.commands.get_cmd_object(cmd_name)
         if cmd_object.hidden:
             continue
-        output = output + format_command(params, cmd_object)
+        formatted[cmd_name] = format_command(params, cmd_object)
+        for alias in cmd_object.aliases:
+            formatted[alias] = format_alias(params, alias, cmd_name)
+    for cmd_name in sorted(formatted):
+        output += formatted[cmd_name]
     return output
 
 
@@ -144,6 +149,12 @@
     return subsection_header + option_str + aliases_str + see_also_str + "\n" + doc + "\n"
 
 
+def format_alias(params, alias, cmd_name):
+    help = '.SS "bzr %s"\n' % alias
+    help += 'Alias for "%s", see "bzr %s".\n' % (cmd_name, cmd_name)
+    return help
+
+
 man_preamble = """\
 .\\\"Man page for Bazaar (%(bzrcmd)s)
 .\\\"




More information about the bazaar-commits mailing list