# The commands
import stgit.commands.add
import stgit.commands.applied
+import stgit.commands.assimilate
import stgit.commands.branch
import stgit.commands.delete
import stgit.commands.diff
commands = {
'add': stgit.commands.add,
'applied': stgit.commands.applied,
+ 'assimilate': stgit.commands.assimilate,
'branch': stgit.commands.branch,
'delete': stgit.commands.delete,
'diff': stgit.commands.diff,
)
stackcommands = (
'applied',
+ 'assimilate',
'clean',
'commit',
'float',
prog = os.path.basename(sys.argv[0])
if len(sys.argv) < 2:
- print >> sys.stderr, 'Unknown command'
+ print >> sys.stderr, 'usage: %s <command>' % prog
print >> sys.stderr, \
' Try "%s --help" for a list of supported commands' % prog
sys.exit(1)
cmd = sys.argv[1]
if cmd in ['-h', '--help']:
- if len(sys.argv) == 3 and sys.argv[2] in commands:
+ if len(sys.argv) >= 3 and sys.argv[2] in commands:
cmd = sys.argv[2]
sys.argv[2] = '--help'
else:
option_list = command.options)
parser.print_help()
else:
- print 'usage: %s help <command>' % prog
-
+ print_help()
sys.exit(0)
if cmd in ['-v', '--version', 'version']:
print 'Stacked GIT %s' % version