Automatic bash completion
authorKarl Hasselström <kha@treskal.com>
Sun, 21 Sep 2008 12:20:41 +0000 (14:20 +0200)
committerKarl Hasselström <kha@treskal.com>
Sun, 21 Sep 2008 12:20:41 +0000 (14:20 +0200)
commit6c8a90e1b43ee2f8e687a2b392fb0ce192e61bda
tree69d2f8b09299a38b5d8590e9766ae4169b02d61f
parentf9d69fc4927827056cba918d9900e638845864f6
Automatic bash completion

Teach the build process to create a bash tab completion script. This
has three benefits:

  1. The tab completion gets faster, since it no longer has to run stg
     to figure out the set of available flags for each command.

  2. The tab completion script used to encode the list of stg
     subcommands, and the kind of arguments each subcommand expected.
     This information now lives in just one place: the subcommand's
     module.

  3. The tab completion script now knows what kind of argument each
     flag wants, and can tab complete those as well. So "stg refresh
     <tab>" will complete dirty files, but "stg refresh -p <tab>" will
     complete patch names.

Signed-off-by: Karl Hasselström <kha@treskal.com>
48 files changed:
.gitignore
Makefile
contrib/stgit-completion.bash [deleted file]
setup.py
stg-build
stgit/argparse.py
stgit/commands/branch.py
stgit/commands/clean.py
stgit/commands/clone.py
stgit/commands/coalesce.py
stgit/commands/commit.py
stgit/commands/delete.py
stgit/commands/diff.py
stgit/commands/edit.py
stgit/commands/export.py
stgit/commands/files.py
stgit/commands/float.py
stgit/commands/fold.py
stgit/commands/goto.py
stgit/commands/hide.py
stgit/commands/id.py
stgit/commands/imprt.py
stgit/commands/init.py
stgit/commands/log.py
stgit/commands/mail.py
stgit/commands/new.py
stgit/commands/patches.py
stgit/commands/pick.py
stgit/commands/pop.py
stgit/commands/pull.py
stgit/commands/push.py
stgit/commands/rebase.py
stgit/commands/redo.py
stgit/commands/refresh.py
stgit/commands/rename.py
stgit/commands/repair.py
stgit/commands/reset.py
stgit/commands/resolved.py
stgit/commands/series.py
stgit/commands/show.py
stgit/commands/sink.py
stgit/commands/status.py
stgit/commands/sync.py
stgit/commands/top.py
stgit/commands/uncommit.py
stgit/commands/undo.py
stgit/commands/unhide.py
stgit/completion.py [new file with mode: 0644]