Prior to this change, this test was failing for me on a new windows
machine, with mismatching drive letters:
helpers_test.go:20: (C:/Users/Foo Bar/cli/altsrc/flag_test.go:195) Expected C:\path\to\source\hello (type string) - Got D:\path\to\source\hello (type string)
Rather than hard-coding the drive letter in the expected path, we can
expect the filepath.Abs'ed version.
This should fix part of #1105.
Some of the docs were lacking or incomplete concerning how to properly
use cli.Exit, cli.HandleExitCoder, and the ExitErrHandler field on cli.App.
This change aims to clarify the usage of those pieces.
I also noticed that we have two identical functions now: cli.Exit and
cli.NewExitError. Since the latter seems to be more recent and less well
documented, I went ahead and marked it as deprecated so that we can keep
our public interface small.
Also added a missing test case for behavior that's been around a while
but was not documented or tested.
Related: #1089
While `HideHelp` hides both `help` command and `--help` flag, `HideHelpCommand`
only hides `help` command and leave `--help` flag as-is.
The behavior of `HideHelp` is untouched in this commit.
Fix#523
Replace #636
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
The new option `app.Suggest` enables command and flag suggestions via
the jaro-winkler distance algorithm. Flags are scoped to their
appropriate commands whereas command suggestions are scoped to the
current command level.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
The usage of the `(default: …)` strings are a bit error prone so we now
refactor them into a dedicated helper function.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>