Commit Graph

33 Commits

Author SHA1 Message Date
Ghislain Gt
98af61a59f Add time.Duration flag type 2014-08-02 22:32:32 +01:00
fc16c67be3 Updating structs to use labels, adding tests for env stuff 2014-07-11 18:13:10 -04:00
97fd93272f Starting to hack in some env var configuration goodness 2014-07-11 13:29:56 -04:00
Jeremy Saenz
bb9189510a Merge pull request #81 from zenoss/upstream/feature/generic-flags
Generic parsers as flag types
2014-05-27 16:54:16 -07:00
Summer Mousa
a911ec75e4 Can now change these default flags in other applications 2014-04-29 09:21:19 -05:00
Pekka Enberg
646b290d5d Make StringSliceFlag usage text consistent
This fixes StringSliceFlag default usage text to be consistent with
IntegerSliceFlag.

Before:

   -f []	`-f option -f option` port forwarding rules

After:

   -f '-f option -f option'	port forwarding rules

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-04-17 11:44:12 +03: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
Jeremy Saenz
640826c88f Merge pull request #78 from zenoss/feature/bash-completion
Bash completion
2014-04-14 10:00:36 -07:00
Summer Mousa
3a10545f91 Made bash completion command optional; still need to update documentation 2014-04-12 08:32:53 -05:00
Ryan Schmukler
312151dca4 remove quotes for empty StringFlags 2014-04-11 15:16:09 -04:00
Yicheng Qin
5903a0a844 Add BoolTFlag type
Compared to BoolFlag type, BoolTFlag treats 'true' as the default value
for the flag.

Without it, we have to use --no-action flag if we set the action is done
in default. But sometimes it is bad to maintain flags with negative meanings.
And it will be painful if we change the default value for the flag.

As this implementation, it keeps all existing functionality. So it
is compatible with old versions.
2014-03-05 17:24:22 -08:00
Katrina Owen
dde48a57c9 Standardize import statements 2013-12-07 07:10:04 -08:00
Katrina Owen
2ec51afe91 Implement Float64Flag. See #46 2013-12-03 05:42:26 -08:00
Ryan S. Brown
28cf49a4ca string slice flag option formatting
Used to output:
```
-- 'name'          -name option -name option%!(EXTRA string=Usage text)
```

Now:
```
--name []          `-name option -name option` Usage text
```
2013-12-02 13:29:43 -06:00
Jeremy Saenz
ab6f1b7c3c Formatting 2013-11-20 17:25:13 -08:00
Jeremy Saenz
4120b604ec Removed help flag. we no longer need it. 2013-11-20 17:24:37 -08:00
Jared Forsyth
dc8a62e0e9 refactor, more robust flag propagation 2013-11-20 01:05:18 -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
Thesyncim
ed96efff1b add simple test , fix errors and unused interface SliceFlag 2013-09-24 20:36:01 +01:00
Thesyncim
4d9038a156 add ability to parse []string types 2013-09-24 02:41:31 +01:00
Mike Gehard
1a1d6bd163 Vary flag prefix based on name length 2013-09-09 11:52:12 -07:00
Mike Gehard
7ec896dde0 Update flag.go
Make boolean flags more in line with standard UNIX boolean flags.
2013-09-09 11:52:12 -07:00
Jeremy Saenz
70eacca641 JMS #25: Added support for help flags 2013-07-24 07:35:45 -07:00
Jeremy Saenz
04490dabec Minor tweaks and cleanup 2013-07-20 08:21:20 -07:00
Jeremy Saenz
6664835bc1 JMS #14: Moving toward having and app object 2013-07-19 08:34:01 -07:00
Jeremy Saenz
3119b075d6 JMS #4: Flag testing 2013-07-18 17:41:22 -07:00
Jeremy Saenz
3f76896c4f JMS #4: Getting some cli tests going. Testing out flags 2013-07-18 17:41:22 -07:00
Jeremy Saenz
04496e4364 JMS #4: More WIP 2013-07-18 17:41:22 -07:00
Jeremy Saenz
e2733adc45 JMS #4: Kinda parsing flags now 2013-07-18 17:41:21 -07:00
Jeremy Saenz
4b4324bb47 JMS #4: Ditched the value for bool flags 2013-07-18 17:41:21 -07:00
Jeremy Saenz
921da63e2e Support for global flags in help text 2013-07-14 19:16:30 -07:00