From: Aaron Bentley Date: Wed, 18 May 2005 19:41:07 +0000 (+0000) Subject: Added inline help to set-root command X-Git-Tag: 1.0.0~283 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=35cb1d08a50bed019f86ef3a81140549475b9045;p=be.git Added inline help to set-root command --- diff --git a/becommands/set_root.py b/becommands/set_root.py index 0ec4c02..c83fd1a 100644 --- a/becommands/set_root.py +++ b/becommands/set_root.py @@ -44,8 +44,9 @@ def execute(args): Traceback (most recent call last): UserError: No such directory: /highly-unlikely-to-exist """ + options, args = get_parser().parse_args(args) if len(args) != 1: - raise cmdutil.UserError("Please supply a directory path") + raise cmdutil.UsageError dir_rcs = rcs.detect(args[0]) if dir_rcs.name is not "None": print "Using %s for revision control." % dir_rcs.name @@ -56,3 +57,21 @@ def execute(args): except bugdir.NoRootEntry: raise cmdutil.UserError("No such directory: %s" % args[0]) print "Directory initialized." + +def get_parser(): + parser = cmdutil.CmdOptionParser("be set-root DIRECTORY") + return parser + +longhelp=""" +This command initializes Bugs Everywhere support for the specified directory +and all its subdirectories. It will auto-detect any supported revision control +system. You can use "be set rcs_name" to change the rcs being used. + +It is usually a good idea to put the Bugs Everywhere root at the source code +root, but you can put it anywhere. If you run "be set-root" in a subdirectory, +then only bugs created in that subdirectory (and its children) will appear +there. +""" + +def help(): + return get_parser().help_str() + longhelp