5 from stgit
import argparse
8 op
= optparse
.OptionParser()
9 op
.add_option('--asciidoc', metavar
= 'CMD',
10 help = 'Print asciidoc documentation for a command')
11 op
.add_option('--commands', action
= 'store_true',
12 help = 'Print list of all stg subcommands')
13 options
, args
= op
.parse_args()
15 op
.error('Wrong number of arguments')
17 argparse
.write_asciidoc(stgit
.main
.commands
[options
.asciidoc
],
19 elif options
.commands
:
20 for cmd
in sorted(stgit
.main
.commands
.iterkeys()):
23 op
.error('No command')
25 if __name__
== '__main__':