Commit Graph

585 Commits

Author SHA1 Message Date
meatballhat ade5513337 Merge pull request #393 from mattfarina/io-Writer
Provide a variable for writing output (the writer) with a default of os.Stderr
2016-05-08 18:39:04 -04:00
Jesse Szwedko 592f1d97e5 Exit non-zero if a unknown subcommand is given
Currently it just prints the help message and exits 0.

We do this by modifying the helpCommand and helpSubcommand cli.Commands
to return an error if they are called with an unknown subcommand. This
propogates up to the app which exits with 3 and prints the error.

Thanks to @danslimmon for the initial approach!

Fixes #276
2016-05-07 17:26:15 -07:00
Jesse Szwedko e3ace79a91 Add GlobalBoolT
Fixes #206
2016-05-07 16:11:26 -07:00
Jesse Szwedko d3a4d5467b Merge pull request #394 from mattfarina/travis-update
Update travis config for Go versions
2016-05-06 22:55:08 -07:00
Jesse Szwedko d919ffad32 Merge pull request #395 from mattfarina/goreportcard
Adding Go Report Card badge
2016-05-06 22:54:45 -07:00
Matt Farina 0a3c5e7516 Letting Travis CI select the patch version of Go 1.4 to use
The last release of Go 1.4 when installed on Travis CI does not
have go vet installed. Letting Travis CI select the patch version
instead.
2016-05-06 12:30:30 -04:00
Matt Farina e9970b7b13 Adding Go Report Card badge 2016-05-06 12:24:51 -04:00
Matt Farina cd230f3a88 Update travis config for Go versions
- Added Go 1.6 testing
- Updated 1.5.x and 1.4.x to latest point releases
2016-05-06 12:19:01 -04:00
Matt Farina 6f0b442222 Update to ErrWriter and make available on app 2016-05-06 12:14:26 -04:00
Matt Farina 2a256d4c53 Provide a variable for writing output with a default of os.Stderr 2016-05-05 10:26:53 -04:00
meatballhat 75b97d09d9 Merge pull request #390 from codegangsta/readme-example-touchup
Assert output in some README examples
2016-05-04 20:04:10 -04:00
Dan Buch 11ad2b36c8 Assert output in some README examples 2016-05-04 19:41:33 -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 f397b1618c Adding test for Command.Hidden handling in help text 2016-05-03 05:51:26 -04:00
Dan Buch 5c641d69b4 Merge branch 'hidden_command' of https://github.com/psmit/cli into psmit-hidden_command 2016-05-03 05:50:36 -04:00
Jesse Szwedko 839f07bfe4 Merge pull request #381 from codegangsta/pluggable-flag-printer
Allow for pluggable flag-level help text formatting
2016-05-02 21:17:00 -07:00
meatballhat b14dcdb7b9 TRIVIAL the letter "a" 2016-05-02 21:20:23 -04:00
Dan Buch cd92adcb75 Further simplifying default flag stringer func 2016-05-02 19:58:16 -04:00
Dan Buch 6089d723a8 Use existing prefixedNames func 2016-05-02 19:52:39 -04:00
Dan Buch 7de151883c Added more notes about usage formatting changes 2016-05-02 19:48:35 -04:00
Dan Buch e56207bd51 Merge branch 'vieux-change_varargs_usage' into pluggable-flag-printer 2016-05-02 19:45:56 -04:00
Dan Buch 2e4d25db14 Merge branch 'change_varargs_usage' of https://github.com/vieux/cli into vieux-change_varargs_usage 2016-05-02 19:45:21 -04:00
Dan Buch 69a8e25f3d Make flag usage rendering more consistent; show default values 2016-05-02 19:42:08 -04:00
Dan Buch 23af5dd643 Rename flag stringer func bits for clarity, consistency 2016-05-02 13:07:57 -04:00
Dan Buch 22773b14c1 Allow for pluggable flag-level help text formatting
by defining `cli.DefaultFlagStringFunc` with a default value that uses
`withEnvHint`, conditionally running a given flag's `FormatValueHelp` if
present.

Closes #257
2016-05-02 13:05:21 -04:00
meatballhat 415b5e766a Merge pull request #380 from codegangsta/readme-cli-refs
Change refs from `cli.go` to cli
2016-05-02 12:06:58 -04:00
Dan Buch 5c36fa18d9 Change refs from cli.go to cli
since the days of this being a single-file library are long gone.
2016-05-02 11:51:54 -04:00
meatballhat d69b4400b5 Merge pull request #379 from codegangsta/v1.16.0-prep
Version 1.16.0 prep
2016-05-02 11:49:06 -04:00
Dan Buch edc8458637 Merge branch 'PaulMakepeace-fix-err-assertion' into v1.16.0-prep 2016-05-02 11:42:18 -04:00
Dan Buch ecf21a7a09 Merge branch 'fix-err-assertion' of https://github.com/PaulMakepeace/cli into PaulMakepeace-fix-err-assertion 2016-05-02 11:41:51 -04:00
Dan Buch fe67cb0f3d Add note about error handling fix, prep 1.16.0 section 2016-05-02 11:41:01 -04:00
meatballhat 4cb9a7a5bb Merge pull request #378 from codegangsta/exit-error-bug-376
Ensure HandleAction/HandleExitCoder work correctly with *ExitError
2016-05-02 11:36:18 -04:00
Dan Buch 4b4c07bd4f Ensure HandleAction/HandleExitCoder work correctly with *ExitError
Closes #376
2016-05-02 11:32:22 -04:00
Gert-Jan Timmer a90e2e4ff1 Fix #376 NewExitError not working, reflect vals[0] cast to Interface() was missing 2016-05-02 17:06:14 +02:00
Paul Makepeace f90241a6a3 Assert type against actual return val's interface.
Exit code example produces now correctly,
	https://github.com/codegangsta/cli#exit-code

	```
	$ ./ec --ginger-crouton=false
	it is not in the soup
	$ echo $?
	86
	$
	```
2016-05-01 20:58:59 -07:00
meatballhat ff84ca213d Merge pull request #374 from codegangsta/kytrinyx-action-err
Merging #135 😻
2016-05-01 10:34:16 -04:00
Dan Buch 1cda555a05 Merge branch 'action-err' of https://github.com/kytrinyx/cli into kytrinyx-action-err 2016-05-01 10:26:54 -04:00
meatballhat fd7bf3b85f Merge pull request #373 from codegangsta/doc-custom-help
Add some explicit docs about help text customization
2016-05-01 10:10:46 -04:00
Dan Buch b738841df8 Add some explicit docs about help text customization 2016-05-01 10:06:12 -04:00
meatballhat e0d7cbbe2c Merge pull request #372 from codegangsta/deprecation-cleanups
Cleaning up the recently-introduced deprecations
2016-05-01 09:18:56 -04:00
meatballhat 784038bca2 Merge pull request #371 from codegangsta/harshavardhana-hidden-flags
Merging #201 - @harshavardhana's hidden flags impl (and more!)
2016-05-01 09:18:41 -04:00
Dan Buch 007295e509 Cleaning up the recently-introduced deprecations
to ensure the intent, responsibility, and migration path are all more clear.
2016-05-01 09:09:54 -04:00
Dan Buch 9584555150 Include details of hidden flag impl in CHANGELOG 2016-05-01 08:44:01 -04:00
Dan Buch fed78b8bab Rework of hidden flag impl plus some Action func corrections 2016-05-01 08:36:17 -04:00
Harshavardhana 99431669d0 New `Hide` variable for all Flags
This is a way to provide hidden flags for app, command and subcommands

For example:

  --generate-bash-completion global flag shouldn't be printed along
  with other flags as it might generally confuse people into thinking
  that 'generate' in-fact would generate a bash completion file for them
  to be used along with their app.

Also in general one would want to hide some flags for their apps.
2016-04-30 22:24:27 -04:00
meatballhat 879acab1d0 Merge pull request #369 from codegangsta/v1.15.0-prep
Prepping v1.15.0 release
2016-04-30 13:53:46 -04:00
Dan Buch a9afed5b15 Prepping v1.15.0 release 2016-04-30 13:48:08 -04:00
meatballhat aaac36ecb9 Merge pull request #368 from codegangsta/yaml-nested-changelog
Add a note to CHANGELOG about dot-delimited YAML key lookup
2016-04-30 13:46:42 -04:00
Dan Buch 896d2fd3c1 Add a note to CHANGELOG about dot-delimited YAML key lookup 2016-04-30 13:27:11 -04:00
meatballhat 15d4455a61 Merge pull request #365 from roboll/nested-flags
altsrc: allow nested defaults in yaml files
2016-04-30 13:25:48 -04:00