##// END OF EJS Templates
Handle unknown commands nicely...
mpm@selenic.com -
r252:5eda6c54 default
parent child Browse files
Show More
@@ -75,7 +75,7 b' def help(ui, cmd=None):'
75 ui.write("%s\n\n" % i[2])
75 ui.write("%s\n\n" % i[2])
76 ui.write(i[0].__doc__, "\n")
76 ui.write(i[0].__doc__, "\n")
77 except UnknownCommand:
77 except UnknownCommand:
78 ui.warn("unknown command %s", cmd)
78 ui.warn("unknown command %s" % cmd)
79 sys.exit(0)
79 sys.exit(0)
80
80
81 ui.status("""\
81 ui.status("""\
@@ -551,8 +551,12 b' def dispatch(args):'
551 u = ui.ui(options["verbose"], options["debug"], options["quiet"],
551 u = ui.ui(options["verbose"], options["debug"], options["quiet"],
552 not options["noninteractive"])
552 not options["noninteractive"])
553
553
554 # deal with unfound commands later
554 try:
555 i = find(cmd)
555 i = find(cmd)
556 except UnknownCommand:
557 u.warn("unknown command '%s'\n" % cmd)
558 help(u)
559 sys.exit(1)
556
560
557 signal.signal(signal.SIGTERM, catchterm)
561 signal.signal(signal.SIGTERM, catchterm)
558
562
General Comments 0
You need to be logged in to leave comments. Login now