X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/33ff9cdd840cfe2780acc41d88d33c8c3bc2761e..408fa7cbdbf88632a7a59b5207e7f564380ed2a6:/stg-build diff --git a/stg-build b/stg-build index 3c9dbfa..2af6523 100755 --- a/stg-build +++ b/stg-build @@ -2,7 +2,7 @@ # -*- python -*- import optparse, sys import stgit.main -from stgit import argparse, commands +from stgit import argparse, commands, completion def main(): op = optparse.OptionParser() @@ -14,6 +14,8 @@ def main(): help = 'Print asciidoc command list') op.add_option('--py-cmd-list', action = 'store_true', help = 'Write Python command list') + op.add_option('--bash-completion', action = 'store_true', + help = 'Write bash completion code') options, args = op.parse_args() if args: op.error('Wrong number of arguments') @@ -30,6 +32,8 @@ def main(): elif options.py_cmd_list: commands.py_commands(commands.get_commands(allow_cached = False), sys.stdout) + elif options.bash_completion: + completion.write_completion(sys.stdout) else: op.error('No command')