chiark / gitweb /
stgit.el: Forbid stgit-{delete,edit,mark,rename} on index and work tree
[stgit] / stg-build
index 3c9dbfa4aba3a631a0758b72007e21cd7b4e92e2..2af652342fb450d949b1502f6d16d89f9394f6c5 100755 (executable)
--- 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')