Commit Graph

15 Commits

Author SHA1 Message Date
Robert Liebowitz
959cf9de8a Update docs and tests around cli.Exit
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
2020-03-24 20:32:39 -04:00
Dan Buch
df5c6caa96
Back out the testify/assert addition 😅 2017-08-04 12:43:16 -04:00
Dan Buch
47a412375f
Resolved compile-time errors since merging from v1 2017-08-04 12:00:22 -04:00
Dan Buch
a61867e5e6
Merge remote-tracking branch 'origin/v1' into merging-from-v1 2017-08-04 11:59:27 -04:00
Jesse Szwedko
9e5b04886c Remove logic that exited even if the error was not an OsExiter
This was introduced in #496, but was discovered to be a regression in
the behavior of the library.
2017-03-04 14:33:36 -08:00
HIROSE Masaaki
adec15acf5 Add another ExitCoder to assert that it uses last one 2017-01-13 15:37:09 +09:00
HIROSE Masaaki
71ced406af Treat rc first called as exit code
Because default OsExiter is os.Exit.
2017-01-12 18:59:38 +09:00
mh-cbon
b0a8f25773 558: handle multi formatter errors 2016-11-13 22:34:31 +01:00
mh-cbon
79591889a9 Close #558: detect FormattedError and print their stack trace 2016-11-05 10:36:23 +01:00
Dan Buch
81c242dda6
Merge remote-tracking branch 'origin/master' into merging-from-v1 2016-08-22 14:41:56 -04:00
Dan Buch
e9688813e4
Refine error handling behavior
so that exit 1 happens as long as error is non-nil
2016-07-24 12:09:05 -04:00
Dan Buch
dd253d122c
Write err to stderr, exit 1 if err != ""
Closes #475
2016-07-24 11:57:51 -04:00
Dan Buch
3d75e9e711
Go with interfaces + private opaque types
rather than public types that wrap slices
2016-05-25 12:05:14 -04:00
Dan Buch
cc481d6b0e
Adjust command hiding to use similar convention as hidden flags
plus breaking out "setup" portion of `App.Run` into its own method, cleaning up
some bits of the help templates, and allowing for runtime opt-in of displaying
template errors to stderr.
2016-05-03 06:54:05 -04:00
Dan Buch
4b4c07bd4f
Ensure HandleAction/HandleExitCoder work correctly with *ExitError
Closes #376
2016-05-02 11:32:22 -04:00