"Summarize src commands, or (with argument) show help for a single command."
print"""
A revision-spec can be a 1-origin revno or a pair of them separated by '-'.
+Revisions can be designated by named tags
+
+The token "--" tells the command-line interpreter that revision-specs
+ad subcommands are done - everything after it is a filename, even
+if it looks like a subcommand or revision number.
src help [command]
Displays help for commands.
"Common setup code."
args = list(args)
revspec = None
- if args and args[0].isdigit():
- revspec = args.pop(0)
- try:
- if "-" in revspec:
- (start, end) = revspec.split("-")
- try:
- start = int(start)
- except ValueError:
- pass
- try:
- end = int(end)
- except ValueError:
- pass
- else:
- try:
- start = int(revspec)
- except ValueError:
- pass
- end = start
- except ValueError:
- croak("malformed revision spec: %s" % revspec)
- revspec = (start, end)
+ if args:
+ if args[0] == "--":
+ args.pop(0)
+ elif args[0].isdigit():
+ revspec = args.pop(0)
+ try:
+ if "-" in revspec:
+ (start, end) = revspec.split("-")
+ try:
+ start = int(start)
+ except ValueError:
+ pass
+ try:
+ end = int(end)
+ except ValueError:
+ pass
+ else:
+ try:
+ start = int(revspec)
+ except ValueError:
+ pass
+ end = start
+ except ValueError:
+ croak("malformed revision spec: %s" % revspec)
+ revspec = (start, end)
if not args:
masters = os.listdir(".src")
if len(masters) == 1:
A revision spec is a 1-origin integer N, or a range literal M..N.
Revisions can be designated by named tags
-src help [command]
+The token "--" tells the command-line interpreter that revision-specs
+ad subcommands are done - everything after it is a filename, even
+if it looks like a subcommand or revision number.
+
+src help [command]::
Displays help for commands.
src init::