diff options
-rw-r--r-- | README.dev | 28 | ||||
-rw-r--r-- | becommands/assign.py | 2 | ||||
-rw-r--r-- | becommands/close.py | 4 | ||||
-rw-r--r-- | becommands/diff.py | 2 | ||||
-rw-r--r-- | becommands/remove.py | 2 | ||||
-rw-r--r-- | becommands/set.py | 2 | ||||
-rw-r--r-- | becommands/set_root.py | 2 | ||||
-rw-r--r-- | becommands/severity.py | 2 | ||||
-rw-r--r-- | becommands/show.py | 2 | ||||
-rw-r--r-- | becommands/status.py | 2 | ||||
-rw-r--r-- | becommands/target.py | 4 |
11 files changed, 40 insertions, 12 deletions
diff --git a/README.dev b/README.dev new file mode 100644 index 0000000..bb39ba5 --- /dev/null +++ b/README.dev @@ -0,0 +1,28 @@ +Extending BE +============ + +To write a plugin, you simply create a new file in the becommands +directory. Take a look at one of the simpler plugins (e.g. open.py) +for an example of how that looks, and to start getting a feel for the +libbe interface. + +To fit into the current framework, your extension module should +provide the following elements: + __desc__ + A short string describing the purpose of your plugin + execute(args) + The entry function for your plugin. args is everything from + sys.argv after the name of your plugin (e.g. for the command + `be open abc', args=['abc']). + help() + Return the string to be output by `be help <yourplugin>', + `be <yourplugin> --help', etc. + +While that's all that's strictly necessary, many plugins (all the +current ones) use libbe.cmdutil.CmdOptionParser to provide a +consistent interface + get_parser() + Return an instance of CmdOptionParser("<usage string>"). You can + alter the parser (e.g. add some more options) before returning it. + +Again, you can just browse around in becommands to get a feel for things. diff --git a/becommands/assign.py b/becommands/assign.py index b01c66a..cb732b3 100644 --- a/becommands/assign.py +++ b/becommands/assign.py @@ -60,7 +60,7 @@ def execute(args): bd.save() def get_parser(): - parser = cmdutil.CmdOptionParser("be assign bug-id [assignee]") + parser = cmdutil.CmdOptionParser("be assign BUG-ID [ASSIGNEE]") return parser longhelp = """ diff --git a/becommands/close.py b/becommands/close.py index 67813f7..8d2ccdb 100644 --- a/becommands/close.py +++ b/becommands/close.py @@ -43,11 +43,11 @@ def execute(args): bd.save() def get_parser(): - parser = cmdutil.CmdOptionParser("be close bug-id") + parser = cmdutil.CmdOptionParser("be close BUG-ID") return parser longhelp=""" -Close the bug identified by bug-id. +Close the bug identified by BUG-ID. """ def help(): diff --git a/becommands/diff.py b/becommands/diff.py index 3a8b42a..77194ff 100644 --- a/becommands/diff.py +++ b/becommands/diff.py @@ -57,7 +57,7 @@ def execute(args): bd.remove_duplicate_bugdir() def get_parser(): - parser = cmdutil.CmdOptionParser("be diff [specifier]") + parser = cmdutil.CmdOptionParser("be diff [SPECIFIER]") return parser longhelp=""" diff --git a/becommands/remove.py b/becommands/remove.py index 6fddb1f..8f7c2c6 100644 --- a/becommands/remove.py +++ b/becommands/remove.py @@ -45,7 +45,7 @@ def execute(args): print "Removed bug %s" % bug.uuid def get_parser(): - parser = cmdutil.CmdOptionParser("be remove bug-id") + parser = cmdutil.CmdOptionParser("be remove BUG-ID") return parser longhelp=""" diff --git a/becommands/set.py b/becommands/set.py index d556ea6..287ceb4 100644 --- a/becommands/set.py +++ b/becommands/set.py @@ -52,7 +52,7 @@ def execute(args): bd.save() def get_parser(): - parser = cmdutil.CmdOptionParser("be set [name] [value]") + parser = cmdutil.CmdOptionParser("be set [NAME] [VALUE]") return parser longhelp=""" diff --git a/becommands/set_root.py b/becommands/set_root.py index 9fb48cb..e17bd87 100644 --- a/becommands/set_root.py +++ b/becommands/set_root.py @@ -88,7 +88,7 @@ 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. -DIRECTORY defaults to your current working directory. +The directory defaults to your current working directory. 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, diff --git a/becommands/severity.py b/becommands/severity.py index 3f25445..3adefaa 100644 --- a/becommands/severity.py +++ b/becommands/severity.py @@ -51,7 +51,7 @@ def execute(args): bd.save() def get_parser(): - parser = cmdutil.CmdOptionParser("be severity bug-id [severity]") + parser = cmdutil.CmdOptionParser("be severity BUG-ID [SEVERITY]") return parser longhelp=[""" diff --git a/becommands/show.py b/becommands/show.py index 9e4e647..abec813 100644 --- a/becommands/show.py +++ b/becommands/show.py @@ -44,7 +44,7 @@ def execute(args): print bug.string(show_comments=True) def get_parser(): - parser = cmdutil.CmdOptionParser("be show bug-id [more bug-ids...]") + parser = cmdutil.CmdOptionParser("be show BUG-ID [BUG-ID ...]") return parser longhelp=""" diff --git a/becommands/status.py b/becommands/status.py index 3dfd548..a30b3d6 100644 --- a/becommands/status.py +++ b/becommands/status.py @@ -51,7 +51,7 @@ def execute(args): bd.save() def get_parser(): - parser = cmdutil.CmdOptionParser("be status bug-id [status]") + parser = cmdutil.CmdOptionParser("be status BUG-ID [STATUS]") return parser longhelp=[""" diff --git a/becommands/target.py b/becommands/target.py index 3ca7710..dce100f 100644 --- a/becommands/target.py +++ b/becommands/target.py @@ -52,13 +52,13 @@ def execute(args): bd.save() def get_parser(): - parser = cmdutil.CmdOptionParser("be target bug-id [target]") + parser = cmdutil.CmdOptionParser("be target BUG-ID [TARGET]") return parser longhelp=""" Show or change a bug's target for fixing. -If no target is specified, the current value is printed. If a target +If no target is specified, the current value is printed. If a target is specified, it will be assigned to the bug. Targets are freeform; any text may be specified. They will generally be |