summaryrefslogtreecommitdiffstats
path: root/repo
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2021-02-18 15:20:15 -0500
committerMike Frysinger <vapier@google.com>2021-02-18 20:38:47 +0000
commit401c6f072564966437a74dc2f33280a85d79dc84 (patch)
tree0b90116d29056d8cd6e1d492cbe37b516e633b6c /repo
parent8c1e9e62a3214a7ab5feeb7ce194ca153cc8afb1 (diff)
downloadgit-repo-401c6f072564966437a74dc2f33280a85d79dc84.tar.gz
init: make --manifest-url flag optional
Since the --manifest-url flag is always required when creating a new checkout, allow the url to be specified via a positional argument. This brings it a little closer to the `git clone` UI. Change-Id: Iaf18e794ae2fa38b20579243d067205cae5fae2f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/297322 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'repo')
-rwxr-xr-xrepo11
1 files changed, 7 insertions, 4 deletions
diff --git a/repo b/repo
index 63cee031..1bc78b89 100755
--- a/repo
+++ b/repo
@@ -270,9 +270,9 @@ gpg_dir = os.path.join(home_dot_repo, 'gnupg')
270def GetParser(gitc_init=False): 270def GetParser(gitc_init=False):
271 """Setup the CLI parser.""" 271 """Setup the CLI parser."""
272 if gitc_init: 272 if gitc_init:
273 usage = 'repo gitc-init -u url -c client [options]' 273 usage = 'repo gitc-init -c client [options] [-u] url'
274 else: 274 else:
275 usage = 'repo init -u url [options]' 275 usage = 'repo init [options] [-u] url'
276 276
277 parser = optparse.OptionParser(usage=usage) 277 parser = optparse.OptionParser(usage=usage)
278 278
@@ -522,8 +522,11 @@ def _Init(args, gitc_init=False):
522 parser = GetParser(gitc_init=gitc_init) 522 parser = GetParser(gitc_init=gitc_init)
523 opt, args = parser.parse_args(args) 523 opt, args = parser.parse_args(args)
524 if args: 524 if args:
525 parser.print_usage() 525 if not opt.manifest_url:
526 sys.exit(1) 526 opt.manifest_url = args.pop(0)
527 if args:
528 parser.print_usage()
529 sys.exit(1)
527 opt.quiet = opt.output_mode is False 530 opt.quiet = opt.output_mode is False
528 opt.verbose = opt.output_mode is True 531 opt.verbose = opt.output_mode is True
529 532