Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 2998 by sudhir.s...@gmail.com: Fix broken 'rbt -h' and 'rbt --help'. (rbt usage help is not helpful enough).
http://code.google.com/p/reviewboard/issues/detail?id=2998

*** For customer support, please post to reviewbo...@googlegroups.com
*** If you have a patch, please submit it to
http://reviews.reviewboard.org/
***
*** Do not post confidential information in this bug report!

What version are you running?
RBTools 0.5.1

What's the URL of the page containing the problem?
rbt tool usage help is not helpful enough. 'rbt -h' and 'rbt --help' is broken.


What steps will reproduce the problem?
$ rbt -h
Usage: rbt [--version] <command> [options] [<args>]

rbt: error: no such option: -h



$ rbt --help
Usage: rbt [--version] <command> [options] [<args>]

rbt: error: no such option: --help


What is the expected output? What do you see instead?

Expected/suggested output is as below. (I am fine as long as options '-h' and '--help' is fixed. Don't have to below output)
sudhirbs@rhel-sudhirbs ~ $ rbt -h
Usage: rbt [--version] <command> [options] [<args>]

Options:
  --version   show program's version number and exit
  -h, --help  Run 'rbt help'


These are standard options which anyone would in Python/Linux/Gnu tools community would expect it to work. If this is not fixed, users may not be able to get help for rbt tool at all.


What operating system are you using? What browser?
Windows and Linux.

Please provide any additional information below.
Below code fix (may not be the best fix) will fix 'rbt -h' and 'rbt --help'


sudhirbs@rhel-sudhirbs  $ svn diff
Index: commands/main.py
===================================================================
--- commands/main.py    (revision 405567)
+++ commands/main.py    (working copy)
@@ -67,9 +67,15 @@
                           option_list=GLOBAL_OPTIONS,
                           add_help_option=False,
                           version='RBTools %s' % get_version_string())
+    parser.add_option('-h', '--help', dest='help', action='store_true',
+                      help = "Run 'rbt help'")
     parser.disable_interspersed_args()
     opt, args = parser.parse_args()

+    if opt.help:
+        parser.print_help()
+        sys.exit()
+
     if not args:
         help([], parser)





--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/reviewboard-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to