Mercurial > hg
comparison mercurial/dispatch.py @ 38788:a9ff2b0c11dd
dispatch: show a short error message when invalid global option given
Similar reasoning as the previous patch.
Differential Revision: https://phab.mercurial-scm.org/D4025
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 24 Jul 2018 10:47:42 -0700 |
parents | 5199c5b6fd29 |
children | 4019b4542e61 |
comparison
equal
deleted
inserted
replaced
38787:5199c5b6fd29 | 38788:a9ff2b0c11dd |
---|---|
368 ui.pager('help') | 368 ui.pager('help') |
369 msgbytes = pycompat.bytestr(inst.args[1]) | 369 msgbytes = pycompat.bytestr(inst.args[1]) |
370 ui.warn(_("hg %s: %s\n") % (inst.args[0], msgbytes)) | 370 ui.warn(_("hg %s: %s\n") % (inst.args[0], msgbytes)) |
371 commands.help_(ui, inst.args[0], full=False, command=True) | 371 commands.help_(ui, inst.args[0], full=False, command=True) |
372 else: | 372 else: |
373 ui.pager('help') | |
374 ui.warn(_("hg: %s\n") % inst.args[1]) | 373 ui.warn(_("hg: %s\n") % inst.args[1]) |
375 commands.help_(ui, 'shortlist') | 374 ui.warn(_("(use 'hg help -v' for a list of global options)\n")) |
376 except error.ParseError as inst: | 375 except error.ParseError as inst: |
377 _formatparse(ui.warn, inst) | 376 _formatparse(ui.warn, inst) |
378 return -1 | 377 return -1 |
379 except error.UnknownCommand as inst: | 378 except error.UnknownCommand as inst: |
380 nocmdmsg = _("hg: unknown command '%s'\n") % inst.args[0] | 379 nocmdmsg = _("hg: unknown command '%s'\n") % inst.args[0] |