# HG changeset patch # User Martin von Zweigbergk # Date 1532454462 25200 # Node ID a9ff2b0c11dd10d7ed8baea6e1a244d809c46d40 # Parent 5199c5b6fd2989ac50d53c11ac43f0402ce7c31c 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 diff -r 5199c5b6fd29 -r a9ff2b0c11dd mercurial/dispatch.py --- a/mercurial/dispatch.py Tue Jul 24 10:22:07 2018 -0700 +++ b/mercurial/dispatch.py Tue Jul 24 10:47:42 2018 -0700 @@ -370,9 +370,8 @@ ui.warn(_("hg %s: %s\n") % (inst.args[0], msgbytes)) commands.help_(ui, inst.args[0], full=False, command=True) else: - ui.pager('help') ui.warn(_("hg: %s\n") % inst.args[1]) - commands.help_(ui, 'shortlist') + ui.warn(_("(use 'hg help -v' for a list of global options)\n")) except error.ParseError as inst: _formatparse(ui.warn, inst) return -1 diff -r 5199c5b6fd29 -r a9ff2b0c11dd tests/test-alias.t --- a/tests/test-alias.t Tue Jul 24 10:22:07 2018 -0700 +++ b/tests/test-alias.t Tue Jul 24 10:47:42 2018 -0700 @@ -651,81 +651,15 @@ $ hg --invalid root hg: option --invalid not recognized - Mercurial Distributed SCM - - basic commands: - - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge another revision into working directory - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) - - (use 'hg help' for the full list of commands or 'hg -v' for details) + (use 'hg help -v' for a list of global options) [255] $ hg --invalid mylog hg: option --invalid not recognized - Mercurial Distributed SCM - - basic commands: - - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge another revision into working directory - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) - - (use 'hg help' for the full list of commands or 'hg -v' for details) + (use 'hg help -v' for a list of global options) [255] $ hg --invalid blank hg: option --invalid not recognized - Mercurial Distributed SCM - - basic commands: - - add add the specified files on the next commit - annotate show changeset information by line for each file - clone make a copy of an existing repository - commit commit the specified files or all outstanding changes - diff diff repository (or selected files) - export dump the header and diffs for one or more changesets - forget forget the specified files on the next commit - init create a new repository in the given directory - log show revision history of entire repository or files - merge merge another revision into working directory - pull pull changes from the specified source - push push changes to the specified destination - remove remove the specified files on the next commit - serve start stand-alone webserver - status show changed files in the working directory - summary summarize working directory state - update update working directory (or switch revisions) - - (use 'hg help' for the full list of commands or 'hg -v' for details) + (use 'hg help -v' for a list of global options) [255] environment variable changes in alias commands