Eclectic Media Git klaus / 4e82832
Add a --version command-line option. Jelmer Vernooij 4 years ago
1 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
88 from dulwich.errors import NotGitRepository
99 from dulwich.repo import Repo
1010
11 from klaus import make_app
11 from klaus import make_app, KLAUS_VERSION
1212 from klaus.utils import force_unicode
1313
1414
2828 parser.add_argument('--host', help="default: 127.0.0.1", default='127.0.0.1')
2929 parser.add_argument('--port', help="default: 8080", default=8080, type=int)
3030 parser.add_argument('--site-name', help="site name showed in header. default: your hostname")
31 parser.add_argument('--version', help='print version number', action='store_true')
3132 parser.add_argument('-b', '--browser', help="open klaus in a browser on server start",
3233 default=False, action='store_true')
3334 parser.add_argument('-B', '--with-browser', help="specify which browser to use with --browser",
5354
5455 def main():
5556 args = make_parser().parse_args()
57
58 if args.version:
59 print KLAUS_VERSION
60 return 0
5661
5762 if args.htdigest and not args.smarthttp:
5863 print >> sys.stderr, "ERROR: --htdigest option has no effect without --smarthttp enabled"