Commit Graph

39 Commits

Author SHA1 Message Date
Dan Buch
cd10b49473
Minimize struct copying
by using pointer func receivers and slices of struct pointers where possible.
2016-05-22 15:20:52 -04:00
Dan Buch
81fcf706ea
Replace all "stringly typed" fields with slice equivalents
and alter the Flag interface accordingly

Closes #415
2016-05-21 21:29:45 -04:00
Dan Buch
9c132d990a
Add more tests for BoolFlag{Value: true} 2016-05-18 08:30:28 -04:00
Dan Buch
f2d5ed9933
Replace BoolTFlag type with BoolFlag.Value
Closes #412
2016-05-18 08:20:15 -04:00
Dan Buch
c19dbaf230
Remove deprecated things and supporting code 2016-05-17 15:11:44 -04:00
Dan Buch
a1e5328e30
Merge remote-tracking branch 'origin/master' into string-slice-flag-default-160 2016-05-03 05:25:07 -04:00
Dan Buch
69a8e25f3d
Make flag usage rendering more consistent; show default values 2016-05-02 19:42:08 -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
Dan Buch
1fb52b3bce
Merge remote-tracking branch 'origin/master' into string-slice-flag-default-160 2016-04-30 13:13:02 -04:00
Dan Buch
1a91f3dce5
Ensure IntSlice & StringSlice serialization works as expected 2016-04-29 02:53:58 -04:00
Dan Buch
64de53e639
Merge remote-tracking branch 'origin/master' into string-slice-flag-default-160 2016-04-28 11:11:42 -04:00
Dan Buch
23c7b807a7
Merge remote-tracking branch 'origin/master' into txgruppi-develop 2016-04-27 09:30:05 -04:00
Dan Buch
b7329f4968
Switch from multi-return with exit codes to ExitCoder check 2016-04-27 09:12:34 -04:00
Dan Buch
10c8309d84
Merge branch 'develop' of https://github.com/txgruppi/cli into txgruppi-develop 2016-04-25 18:10:10 -04:00
Kevin Cantwell
13b7eedc13 Parses usage placeholders via back quotes. Resolves #333 2016-04-21 23:04:01 -04:00
Dan Buch
cb433e7468 Use NewIntSlice and NewStringSlice internally 2016-04-05 22:38:31 -04:00
Dan Buch
867aa0912d Overwrite slice flag defaults when set
Closes #160
2016-04-05 12:35:30 -04:00
Gregor Noczinski
82ddbd9a07 * Improve GenericFlag.String() by suppressing empty "" for GenericFlags on nil or empty Generic.String()
* Cleanup StringFlag.String()
* Add os specific envHint handling for Windows (%ENV_VAR% instead of $ENV_VAR on posix systems)
2016-01-22 15:08:27 +01:00
ston1th
25ef368235 added destination scan testing and BoolT 2015-11-14 22:39:38 +01:00
Tarcísio Gruppi
1510d7e722
Updated tests to support exit code 2015-07-28 20:29:13 +02:00
Edward Sheffler III
8ea1232ede Improve vendoring options by removing self-referential imports in tests. 2015-07-20 12:28:51 -07:00
jszwedko
059c02782a Use double quotes in output for defaults
Windows doesn't recognize 's for wrapping values. "s should work on all
systems.
2015-01-08 15:35:23 -05:00
jszwedko
22dbe6ffdc Fix help text for generic flag to not insinuate that you can specify multiple
Feels like it may have been copied from StringSliceFlag or something,
but update the output to be more consistent with other single value
flags.

Also added comments to the String and Apply functions.
2015-01-08 14:27:09 -05:00
78d497e4cf Adding support for multiple env var "cascade" 2014-09-22 23:28:57 -04:00
Ghislain Gt
98af61a59f Add time.Duration flag type 2014-08-02 22:32:32 +01:00
48869e13a4 Addressing go vet offenses 2014-07-11 18:30:16 -04:00
fc16c67be3 Updating structs to use labels, adding tests for env stuff 2014-07-11 18:13:10 -04:00
Summer Mousa
1eaa882c3a removed extranneous value method on the generic type 2014-04-15 09:57:11 -05:00
Summer Mousa
13e88629f5 Generic parsers as flag types 2014-04-15 09:16:47 -05:00
Ryan Schmukler
312151dca4 remove quotes for empty StringFlags 2014-04-11 15:16:09 -04:00
Yicheng Qin
ce13660ae0 fix(context): copy StringSlice Flag correctly 2014-03-21 17:18:14 -07:00
Katrina Owen
2ec51afe91 Implement Float64Flag. See #46 2013-12-03 05:42:26 -08:00
Jeremy Saenz
806cdc2890 removed dead test 2013-11-20 17:26:27 -08:00
Jeremy Saenz
ab6f1b7c3c Formatting 2013-11-20 17:25:13 -08:00
Jared Forsyth
dc8a62e0e9 refactor, more robust flag propagation 2013-11-20 01:05:18 -07:00
Jared Forsyth
73e88630a5 fmt 2013-11-18 16:37:59 -07:00
Jared Forsyth
ccb1528bb0 adding multi-named flags 2013-11-18 16:35:23 -07:00
Jeremy Saenz
0d3c3f4497 Improved documentation 2013-11-01 07:31:37 -07:00
Mike Gehard
1a1d6bd163 Vary flag prefix based on name length 2013-09-09 11:52:12 -07:00