|
@@ -819,6 +819,7 @@ def _FindRepo():
|
|
|
|
|
|
|
|
class _Options(object):
|
|
class _Options(object):
|
|
|
help = False
|
|
help = False
|
|
|
|
|
+ version = False
|
|
|
|
|
|
|
|
|
|
|
|
|
def _ParseArguments(args):
|
|
def _ParseArguments(args):
|
|
@@ -830,7 +831,8 @@ def _ParseArguments(args):
|
|
|
a = args[i]
|
|
a = args[i]
|
|
|
if a == '-h' or a == '--help':
|
|
if a == '-h' or a == '--help':
|
|
|
opt.help = True
|
|
opt.help = True
|
|
|
-
|
|
|
|
|
|
|
+ elif a == '--version':
|
|
|
|
|
+ opt.version = True
|
|
|
elif not a.startswith('-'):
|
|
elif not a.startswith('-'):
|
|
|
cmd = a
|
|
cmd = a
|
|
|
arg = args[i + 1:]
|
|
arg = args[i + 1:]
|
|
@@ -877,6 +879,16 @@ def _Help(args):
|
|
|
sys.exit(1)
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+def _Version():
|
|
|
|
|
+ """Show version information."""
|
|
|
|
|
+ print('<repo not installed>')
|
|
|
|
|
+ print('repo launcher version %s' % ('.'.join(str(x) for x in VERSION),))
|
|
|
|
|
+ print(' (from %s)' % (__file__,))
|
|
|
|
|
+ print('git %s' % (ParseGitVersion().full,))
|
|
|
|
|
+ print('Python %s' % sys.version)
|
|
|
|
|
+ sys.exit(0)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
def _NotInstalled():
|
|
def _NotInstalled():
|
|
|
print('error: repo is not installed. Use "repo init" to install it here.',
|
|
print('error: repo is not installed. Use "repo init" to install it here.',
|
|
|
file=sys.stderr)
|
|
file=sys.stderr)
|
|
@@ -953,6 +965,8 @@ def main(orig_args):
|
|
|
_Usage()
|
|
_Usage()
|
|
|
if cmd == 'help':
|
|
if cmd == 'help':
|
|
|
_Help(args)
|
|
_Help(args)
|
|
|
|
|
+ if opt.version or cmd == 'version':
|
|
|
|
|
+ _Version()
|
|
|
if not cmd:
|
|
if not cmd:
|
|
|
_NotInstalled()
|
|
_NotInstalled()
|
|
|
if cmd == 'init' or cmd == 'gitc-init':
|
|
if cmd == 'init' or cmd == 'gitc-init':
|