Mercurial > public > mercurial-scm > hg-stable
diff tests/test-help.t @ 21289:c3784e3c3e8d
help: suggest keyword search when no topic is found
When `hg help foobar` fails, it now suggests using `hg help --keyword foobar`
instead of printing a full page of basic commands.
This should greatly increases discoverability of the `hg help --keyword`
argument.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 16 Apr 2014 19:55:40 -0400 |
parents | eb6eaef7ae44 |
children | 0c6cdbb697d9 |
line wrap: on
line diff
--- a/tests/test-help.t Wed Apr 16 20:01:03 2014 -0400 +++ b/tests/test-help.t Wed Apr 16 19:55:40 2014 -0400 @@ -596,30 +596,8 @@ show changed files in the working directory $ hg help foo - hg: unknown command 'foo' - 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 working directory with another revision - 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 + abort: no such help topic: foo + (try "hg help --keyword foo") [255] $ hg skjdfks @@ -988,6 +966,13 @@ qclone clone main and patch repository at same time +Test unfound topic + + $ hg help nonexistingtopicthatwillneverexisteverever + abort: no such help topic: nonexistingtopicthatwillneverexisteverever + (try "hg help --keyword nonexistingtopicthatwillneverexisteverever") + [255] + Test unfound keyword $ hg help --keyword nonexistingwordthatwillneverexisteverever