##// END OF EJS Templates
cmdutil: better document command()
Gregory Szorc -
r21766:a039e1f2 default
parent child Browse files
Show More
@@ -2473,8 +2473,23 def _performrevert(repo, parents, ctx, a
2473 2473 repo.dirstate.copy(copied[f], f)
2474 2474
2475 2475 def command(table):
2476 '''returns a function object bound to table which can be used as
2477 a decorator for populating table as a command table'''
2476 """Returns a function object to be used as a decorator for making commands.
2477
2478 This function receives a command table as its argument. The table should
2479 be a dict.
2480
2481 The returned function can be used as a decorator for adding commands
2482 to that command table. This function accepts multiple arguments to define
2483 a command.
2484
2485 The first argument is the command name.
2486
2487 The options argument is an iterable of tuples defining command arguments.
2488 See ``mercurial.fancyopts.fancyopts()`` for the format of each tuple.
2489
2490 The synopsis argument defines a short, one line summary of how to use the
2491 command. This shows up in the help output.
2492 """
2478 2493
2479 2494 def cmd(name, options=(), synopsis=None):
2480 2495 def decorator(func):
General Comments 0
You need to be logged in to leave comments. Login now