1 from __future__
import division
, absolute_import
, unicode_literals
6 from cola
.widgets
.dag
import git_dag
11 args
= parse_args(argv
=argv
)
12 return args
.func(args
)
16 """Windows git-dag entrypoint"""
17 return app
.winmain(main
)
20 def shortcut_launch():
21 """Run git-dag from a Windows shortcut"""
22 return app
.winmain(main
, ['--prompt'])
25 def parse_args(argv
=None):
26 """Parse command-line arguments"""
29 parser
= argparse
.ArgumentParser()
30 parser
.set_defaults(func
=cmd_dag
)
32 app
.add_common_arguments(parser
)
33 parser
.add_argument('-c', '--count', '--max-count', metavar
='<count>',
34 type=int, default
=1000,
35 help='number of commits to display')
36 parser
.add_argument('args', nargs
='*', metavar
='<args>',
37 help='git log arguments')
38 args
, rest
= parser
.parse_known_args(args
=argv
)
40 # splice unknown arguments to the beginning ~
41 # these are forwarded to git-log(1).
47 """Run git-dag via the `git cola dag` sub-command"""
48 context
= app
.application_init(args
)
49 view
= git_dag(context
, args
=args
, settings
=args
.settings
, show
=False)
50 return app
.application_start(context
, view
)