1 from __future__
import absolute_import
, division
, print_function
, unicode_literals
6 from cola
.widgets
.dag
import git_dag
12 args
= parse_args(argv
=argv
)
13 return args
.func(args
)
16 def shortcut_launch():
17 """Run git-dag from a Windows shortcut"""
18 return main(argv
=['--prompt'])
21 def parse_args(argv
=None):
22 """Parse command-line arguments"""
25 parser
= argparse
.ArgumentParser()
26 parser
.set_defaults(func
=cmd_dag
)
28 app
.add_common_arguments(parser
)
36 help='number of commits to display',
38 parser
.add_argument('args', nargs
='*', metavar
='<args>', help='git log arguments')
39 args
, rest
= parser
.parse_known_args(args
=argv
)
41 # splice unknown arguments to the beginning ~
42 # these are forwarded to git-log(1).
48 """Run git-dag via the `git cola dag` sub-command"""
49 context
= app
.application_init(args
)
50 view
= git_dag(context
, args
=args
, show
=False)
51 return app
.application_start(context
, view
)