]> arthur.barton.de Git - bup.git/blob - cmd/version-cmd.py
options: remove unused 'exe' parameter
[bup.git] / cmd / version-cmd.py
1 #!/usr/bin/env python
2 import sys
3 from bup import options
4 from bup.helpers import *
5
6 optspec = """
7 bup version [--date|--commit|--tag]
8 --
9 date    display the date this version of bup was created
10 commit  display the git commit id of this version of bup
11 tag     display the tag name of this version.  If no tag is available, display the commit id
12 """
13 o = options.Options(optspec)
14 (opt, flags, extra) = o.parse(sys.argv[1:])
15
16
17 total = (opt.date or 0) + (opt.commit or 0) + (opt.tag or 0)
18 if total > 1:
19     o.fatal('at most one option expected')
20
21 if opt.date:
22     print version_date()
23 elif opt.commit:
24     print version_commit()
25 else:
26     print version_tag()