comparison mercurial/dispatch.py @ 38787:5199c5b6fd29

dispatch: don't show list of commands on bogus command If a command is ambiguous, you get this: $ hg ve hg: command 've' is ambiguous: verify version [255] If you typo a command, you get this: $ hg comit hg: unknown command 'comit' (did you mean one of commit, incoming, mycommit?) [255] But if you completely mistype a command so it no longer looks like any existing commands, you get a full list of commands. That might be useful the first time you use Mercurial, but after that it's probably more annoying than help, especially if you have the pager enabled and have a short terminal. Let's instead give a short hint telling the user to run `hg help` for more help. Differential Revision: https://phab.mercurial-scm.org/D4024
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 24 Jul 2018 10:22:07 -0700
parents afc4ad706f9c
children a9ff2b0c11dd
comparison
equal deleted inserted replaced
38786:28d8b5f49b4d 38787:5199c5b6fd29
392 if sim: 392 if sim:
393 ui.warn(nocmdmsg) 393 ui.warn(nocmdmsg)
394 _reportsimilar(ui.warn, sim) 394 _reportsimilar(ui.warn, sim)
395 suggested = True 395 suggested = True
396 if not suggested: 396 if not suggested:
397 ui.pager('help')
398 ui.warn(nocmdmsg) 397 ui.warn(nocmdmsg)
399 commands.help_(ui, 'shortlist') 398 ui.warn(_("(use 'hg help' for a list of commands)\n"))
400 except IOError: 399 except IOError:
401 raise 400 raise
402 except KeyboardInterrupt: 401 except KeyboardInterrupt:
403 raise 402 raise
404 except: # probably re-raises 403 except: # probably re-raises