[PATCH] Improve help usability

Goffredo Baroncelli kreijack at alice.it
Tue Aug 23 23:20:13 BST 2005


Hi all,

the patch below shows the /short/ help when bzr is invoked without parameter. Moreover
if bzr is invoked with the 'help' command ( or -h or --help ) the full help is displayed.
I think that this behaviour is more user frendly.

examples:

ghigo at therra:~/bazar/bzr-help$ python ./bzr
Bazaar-NG -- a free distributed version-control tool
http://bazaar-ng.org/

WARNING: This is an unstable development version.
         Please keep backups.

Basic commands:

  bzr init      makes this branch versioned
  bzr branch    make a copy of another branch

  bzr add       make files or directories versioned
  bzr ignore    ignore a file or pattern
  bzr mv        move or rename a versioned file

  bzr status    summarize changes in working copy
  bzr diff      show detailed diffs

  bzr merge     pull in changes from another branch
  bzr commit

  bzr log       show history of changes
  bzr check     validate storage

Use e.g. 'bzr help init' for more details, or 'bzr help' for
all commands.


ghigo at therra:~/bazar/bzr-help$ python ./bzr help
add [FILE...]
    Add specified files or directories.
branch FROM_LOCATION [TO_LOCATION]
    Create a new copy of a branch.
cat FILENAME
    Write a file's text from a previous revision.
check [DIR]
    Validate consistency of branch history.
commit [SELECTED...]
 [...]


Goffredo

----------------

ghigo at therra:~/bazar/bzr-help$ python ./bzr diff
*** modified file 'bzrlib/commands.py'
--- bzrlib/commands.py
+++ bzrlib/commands.py
@@ -1546,7 +1546,7 @@
     takes_args = ['topic?']
     aliases = ['?']

-    def run(self, topic=None):
+    def run(self, topic="commands"):
         import help
         help.help(topic)

@@ -1842,7 +1842,7 @@
         if args:
             help(args[0])
         else:
-            help()
+            help("commands")
         return 0

     if 'version' in opts:
@@ -1850,8 +1850,9 @@
         return 0

     if not args:
-        print >>sys.stderr, "please try 'bzr help' for help"
-        return 1
+        from bzrlib.help import help
+        help(None)
+        return 0

     cmd = str(args.pop(0))


*** modified file 'bzrlib/help.py'
--- bzrlib/help.py
+++ bzrlib/help.py
@@ -39,7 +39,7 @@
   bzr log       show history of changes
   bzr check     validate storage

-Use e.g. 'bzr help init' for more details, or 'bzr help commands' for
+Use e.g. 'bzr help init' for more details, or 'bzr help' for
 all commands.
 """


-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack @ inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87  87C0 BB86 505C 6B2A CFF9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050824/a45f0056/attachment.pgp 


More information about the bazaar mailing list