aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-14Use flag's string type in usagebogem
Now in usage shows flag.Value.Type() instead of flag.Value.(type), what makes library more flexible
2016-08-04Merge pull request #84 from apelisse/fix-empty-string-sliceEric Paris
Fix string_slice with empty value
2016-08-03Fix string_slice with empty valueAntoine Pelisse
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.
2016-07-18Bump Go versions in Travis configBjørn Erik Pedersen
2016-06-24Removed unused field "exitOnError".Jonathan Barronville
2016-06-10Merge pull request #74 from alexbrand/masterEric Paris
Document AddGoFlagSet method in the README file
2016-06-09Document AddGoFlagSet method in the README fileAlexander Brand
2016-04-27Passthrough flags inserted by go testMoshe Cohen
2016-04-27Fix a typo in READMEJake Worth
2016-04-13Merge pull request #67 from johnSchnake/availableFlagsEric Paris
Add simple method to see if a flagset has available flags
2016-04-11Add simple method to see if a flagset has available flagsJohn Schnake
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.
2016-04-11Merge pull request #69 from johnSchnake/travisUpdateEric Paris
Remove go 1.3 and 1.4 from travis; add 1.6
2016-04-11Remove go 1.3 and 1.4 from travis; add 1.6John Schnake
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.
2015-12-18Issue #55: implement Go 1.5-style default usage formatting.Giovanni Bajo
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.
2015-12-18Better support golang flag short valuesEric Paris
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.
2015-10-13Merge pull request #59 from eparis/csv-escapingEric Paris
Use encoding/csv to parse string slices
2015-10-13And test go 1.5 while we are at itEric Paris
2015-10-13Use encoding/csv to parse string slicesEric Paris
There was no way to escape or use a , in a string slice so use the encoding/csv library, rather than string.split() and let golang take care of the encoding issues.
2015-09-23Merge pull request #58 from eparis/code-cleanlinessEric Paris
Add more CI checks forcing code cleanliness
2015-09-23Add more CI checks forcing code cleanlinessEric Paris
2015-09-17Merge pull request #56 from eparis/len-at-dashEric Paris
Store the length of Args when a -- is found in commandline
2015-09-16Store the length of Args when a -- is found in commandlineEric Paris
This allows a program to know what args came before the -- and what args came after.
2015-09-08Merge pull request #53 from sdomino/feature/private-flagsEric Paris
private flags
2015-09-07adding a private field to flags, and a function for marking flags as privateSteve Domino
removing some c/p left-overs from the MarkPrivate function, and updating the comment slightly changed field from Private to Hidden. Added documentation w/example to README.md. Added testing to confirm hidden flags updating test message
2015-08-20Merge pull request #52 from JanetKuo/shorthand-deprecatorEric Paris
Add shorthand deprecator
2015-08-20Add shorthand deprecatorJanet Kuo
2015-08-16Merge pull request #51 from eparis/golangflag-defvalEric Paris
Do not trust golang flag's DefValue
2015-08-16Do not trust golang flag's DefValueEric Paris
Apparently it is wrong :-(. Use the current value instead. It is at least the default at the moment that pflag learned about the flag.
2015-08-16Merge pull request #49 from eparis/golangflagsEric Paris
Support merging golang flags into pflags
2015-08-16Add functions to support golang flags in pflagsEric Paris
They aren't "perfect". spf13/pflag chose to use an explicit `Type` in the value. golang has nothing of the sort and has a rather crazy IsBoolFlag() bit of nonsense for the one case that really makes sense to have the explicit `Type`. Probably because adding interfaces really screws people up. So supporting golang flags in pflags isn't super super simple, we need to figure out how to handle our `Type` given only the information available in a golang flag. This does it as best we can with `reflect`.
2015-08-16Merge pull request #48 from eparis/addFlagSetEric Paris
New AddFlagSet function on FlagSet
2015-08-15New AddFlagSet function on FlagSetEric Paris
This function allows one to create a different FlagSets and then easily merge them together.
2015-08-15Merge pull request #45 from eparis/use-typeEric Paris
Use Type() instead of internal .(*stringValue)
2015-08-15Use Type() instead of internal .(*stringValue)Eric Paris
This makes things easier to read/understand and it also means that users who declare their own flags and call them "string" will get quotes as well.
2015-08-15Merge pull request #46 from eparis/goreportcardEric Paris
Fix up minor things found by goreportcard.com
2015-08-15Merge pull request #47 from eparis/usageMergeEric Paris
Reduce code duplication in PrintDefaults/FlagUsages
2015-08-15Reduce code duplication in PrintDefaults/FlagUsagesEric Paris
They both did the same thing. So use one in the other.
2015-08-15Fix up minor things found by goreportcard.comEric Paris
2015-08-15Merge pull request #44 from eparis/optional-flag-displayEric Paris
Display which flags are optional flags in usageFunc
2015-08-14Annotate optional flags in usageFuncEric Paris
2015-08-14Merge pull request #43 from technoweenie/typo-anxietyEric Paris
Fix a couple typos.
2015-08-14typoRick Olson
2015-08-12Merge pull request #41 from eparis/fix-slice-defaultsEric Paris
Do not append to default values in {String,Int}Slice
2015-08-12Merge pull request #42 from eparis/ogier-pickEric Paris
Fix typo in bool_test.go
2015-08-12Fix typo in bool_test.gossgelm
(cherry picked from commit faf06f062514fcb3a92c325d15bf312d1be84f94)
2015-08-12Do not append to default values in {String,Int}SliceEric Paris
I added the ability to do: `-s=bob -s=john` and get `[]string{"bob", "john"}` But if a default value was set to say `[]string{"eric"}` the above operation was mistakenly resulting in: `[]string{"eric", "bob", "john"} which was obviously not what was intended. This is fixed by tracking if a value was parsed and overwriting the default on the first time -s is found, but we append the 2+ time.
2015-08-07Merge pull request #39 from eparis/changed-helperEric Paris
More tests for Changed
2015-08-07More tests for ChangedEric Paris
2015-08-07Merge pull request #38 from eparis/changed-helperEric Paris
New helper to easily see if a flag has been set
2015-08-07New helper to easily see if a flag has been setEric Paris
A lot easier than having to do it in the user over and over and over.