| Age | Commit message (Collapse) | Author |
|
Clean up code
|
|
add badges to README.md
|
|
|
|
add user supplied function when parse()
|
|
We basically want to allow callers to use our command line parser. There
is a user who wants to log the command line, but they don't want to log
"sensitive" flags. This allows that user to parse the command line and
get each flag. They can use information in the flag to write their own
printer.
|
|
not enough arguments in call to flag.BoolVarP and too many arguments in call to flag.VarP
|
|
Signed-off-by: yuanxiao <[email protected]>
|
|
Fails to go get golint.
Also bump Go 1.7 to 1.7.3
|
|
|
|
Don't print escaped strings for the default value of string
|
|
default is set.
Signed-off-by: Daniel Nephin <[email protected]>
|
|
Don't print escaped strings for the default value of string flags.
|
|
Signed-off-by: Daniel Nephin <[email protected]>
|
|
Fix square bracket handling in string_array
|
|
Same issue fixed in 13e924de for string_slice.
|
|
fix bug of string_slice with square brackets
|
|
|
|
Optimize fmt statements
|
|
|
|
Use strconv instead of fmt in some values' String funcs
|
|
Fix default values for custom fields
|
|
The existing implementation of flag values with fmt package uses
more memory and works slower than the implementation with strconv
package.
|
|
Fallback to the original default detection logic if we have an unknown
type.
Fixes #91
|
|
add a new type StringArray
|
|
|
|
Some minor fixes
|
|
|
|
|
|
Fix bug in FlagSet.GetStringSlice when a comma in a string slice value
|
|
|
|
Fix default value detection for Go 1.7
|
|
|
|
In Go 1.7 the default value for a time.Duration will change from "0" to
"0s". This commit replaces the simplistic `isZeroValue` with a more
intelligent implementation that checks for zero values based
upon the specific type of the flag.
|
|
Use flag's string type in usage
|
|
Now in usage shows flag.Value.Type() instead of flag.Value.(type), what makes library more flexible
|
|
Fix string_slice with empty value
|
|
Currently, if you don't set any value for a StringSliceVar, it will
end-up failing with an EOF error. It fails because the CSV parser for
the value can't read anything.
Special case when the string is empty to return an empty list.
|
|
|
|
|
|
Document AddGoFlagSet method in the README file
|
|
|
|
|
|
|
|
Add simple method to see if a flagset has available flags
|
|
With the hidden and deprecated fields, it is useful to be able
to ask if a flagset has any non-hdden, non-deprecated flags.
One example of this is to aid in writing help templates.
|
|
Remove go 1.3 and 1.4 from travis; add 1.6
|
|
Due to the age of 1.3 and 1.4, removing them from travis. They
currently are incompatible with golint as well, meaning that we,
otherwise, need to remove golint in testing.
|
|
Compare to 1.4, the main difference in formatting is
the placement of default values. Moreover, UnquoteUsage()
is now added (and exported, for full API compatibility
with the standard flag package), so backtick words in
usage messages can be used to set the placeholder name.
Compared to the standard flag package, this patch
always prints usage in one-line, with automatic
alignment, because I feel that the 1.4 output is very
confusing when modified to include also dash-dash flags.
|
|
In golang flags -bob and --bob are the same thing. Not so in pflags. But
when a golang flag was just -b or --b we would still only support --b.
This was a little awkward to users.
If a golang flag was declared as a single character, support both the -b
and --b versions in the pflag version.
|
|
Use encoding/csv to parse string slices
|