I tried to stick to CAPS for argument placeholders.
--- /dev/null
+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.
bd.save()
def get_parser():
- parser = cmdutil.CmdOptionParser("be assign bug-id [assignee]")
+ parser = cmdutil.CmdOptionParser("be assign BUG-ID [ASSIGNEE]")
return parser
longhelp = """
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():
bd.remove_duplicate_bugdir()
def get_parser():
- parser = cmdutil.CmdOptionParser("be diff [specifier]")
+ parser = cmdutil.CmdOptionParser("be diff [SPECIFIER]")
return parser
longhelp="""
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="""
bd.save()
def get_parser():
- parser = cmdutil.CmdOptionParser("be set [name] [value]")
+ parser = cmdutil.CmdOptionParser("be set [NAME] [VALUE]")
return parser
longhelp="""
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,
bd.save()
def get_parser():
- parser = cmdutil.CmdOptionParser("be severity bug-id [severity]")
+ parser = cmdutil.CmdOptionParser("be severity BUG-ID [SEVERITY]")
return parser
longhelp=["""
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="""
bd.save()
def get_parser():
- parser = cmdutil.CmdOptionParser("be status bug-id [status]")
+ parser = cmdutil.CmdOptionParser("be status BUG-ID [STATUS]")
return parser
longhelp=["""
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