aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-07-17Add some contributor docsdocs/contribTomas Aschan
2025-07-16Merge pull request #348 from max-frank/add-time-flag-supportv1.0.7Tomas Aschan
Add support for time.Time flags
2025-07-16Reduce duplication by forwarding to sibling functionsTomas Aschan
2025-07-16Don't export `TimeValue` (yet)Tomas Aschan
2025-07-14Remove unnecessary time test stderr dev null redirectMaximilian Frank
2025-07-14Use time.Time for expectations in time flag testsMaximilian Frank
2025-07-14Add support for time.Time flagsMaximilian Frank
2025-06-28Merge pull request #431 from LeGEC/430-fix-usage-message-for-func-flagsTomas Aschan
fix usage message for func flags, fix arguments order
2025-06-27fix discrepancy in order of arguments for Func() and BoolFunc() #433Georges Varouchas
for no good reason: the order of arguments would differ when calling pflag.BoolFuncP(...) and (*FlagSet).BoolFuncP(...) (same goes for Func() and FuncP()) in this commit: align all functions on stdlib's order fixes #433
2025-06-09fix help message for Func and BoolFunc flags #430Georges Varouchas
* have '.Type()' for boolfuncValue return "boolfunc" (dedicated value, which now makes it distinct from funcValue) * hide extra "(default )" by stating that "" should be treated as a zero value for a boolFlag note: - a boolfuncValue matches 'case boolFlag:', as it implements the boolFlag interface, - treating "" as a value which shouldn't trigger a "(default )" for a regular Bool flag does not look like a breaking change * hide extra "[=something]" for boolfuncValue * set default placeholder name for "boolfunc" and "func" flag types
2025-06-09minor: fix typos in commentsGeorges Varouchas
2025-06-01Merge pull request #409 from ShawnJeffersonWang/masterTomas Aschan
fix: correct argument length check in FlagSet.Parse
2025-05-24Merge pull request #429 from LeGEC/426-add-func-and-bool-funcTomas Aschan
add support for Func() and BoolFunc() #426
2025-05-22add support for Func() and BoolFunc() #426Georges Varouchas
Add support for two features which landed in the 'flag' package from the standard library: Func() and BoolFunc() and their two pflag specific versions: FuncP() and BoolFuncP() fixes #426
2025-05-15Merge pull request #418 from hujun-open/masterTomas Aschan
add support equivalent to golang flag.TextVar(), also fixes the test failure as described in #368
2025-05-14Merge pull request #424 from valdar/issue/423Tomas Aschan
fix #423 : Add helper function and some documentation to parse shorthand go test flags.
2025-05-14fix #423 : Add helper function and some documentation to parse shorthand go ↵Andrea Tarocchi
test flags.
2025-05-10- update text_test.go based on PR review commentsHu Jun
- return is missing in one error path of GetText(), fixed
2025-05-07Merge pull request #428 from co63oc/fix1Tomas Aschan
Fix typos
2025-05-06Fix typosco63oc
2025-04-28Merge remote-tracking branch 'upstream/master'Hu Jun
2025-04-22Merge pull request #425 from eth-p/error-structsTomas Aschan
feat: Use structs for errors returned by pflag.
2025-04-21test: Add tests for error structsEthan P.
2025-04-21feat: Add getters to error structsEthan P.
2025-04-21feat: Use error structs for most returned errorsEthan P.
This allows callers to differentiate between error types without having to parse the error message string.
2025-04-21test: Commonly-returned error messagesEthan P.
Add tests to ensure invalid arguments and unknown flag error messages don't change.
2025-04-01Merge pull request #422 from ↵Tomas Aschan
MidnightRocket/fix-default-is-zerovalue-for-generic-value-type Fix defaultIsZeroValue check for generic Value types
2025-04-01Improve readability for error in TestPrintDefaultsMidnightRocket
2025-04-01Add better test for defaultIsZeroValue for generic Value typeMidnightRocket
2025-03-18Fix defaultIsZeroValue check for generic Value typeMidnightRocket
2025-03-08Merge remote-tracking branch 'upstream/master'Hu Jun
2025-01-09Merge pull request #419 from spf13/civ1.0.6Márk Sági-Kazár
add github actions
2025-01-09disable unsupported dependency graph for nowMark Sagi-Kazar
Signed-off-by: Mark Sagi-Kazar <[email protected]>
2025-01-09fix govetMark Sagi-Kazar
Signed-off-by: Mark Sagi-Kazar <[email protected]>
2025-01-09add github actionsMark Sagi-Kazar
Signed-off-by: Mark Sagi-Kazar <[email protected]>
2024-12-27add support equivalent to golang flag.TextVar(), also fixes the test failure ↵Hu Jun
as described in #368
2024-12-05fix: add test for argument length checkshawn
2024-07-23fix: correct argument length check in FlagSet.Parseshawn
Signed-off-by: shawn <[email protected]>
2021-06-04allow for blank ip addresses (#316)David Rivera
2020-10-09Add IPNetSlice and unit tests (#170)rpothier
2020-09-10remove dead code for checking error nil (#282)Yash
2020-05-04Add exported functions to preserve `pkg/flag` compatibility (#220)Ryan McKern
* Rename out() to Output() This brings behavior inline with go's flag library, and allows for printing output directly to whatever the current FlagSet is using for output. This change will make it easier to correctly emit output to stdout or stderr (e.g. a user has requested a help screen, which should emit to stdout since it's the desired outcome). * improve compat. with pkg/flag by adding Name() pkg/flag has a public `Name()` function, which returns the name of the flag set when called. This commit adds that function, as well as a test for it. * Streamline testing Name() Testing `Name()` will move into its own explicit test, instead of running inline during `TestAddFlagSet()`. Co-authored-by: Chloe Kudryavtsev <[email protected]> Co-authored-by: Chloe Kudryavtsev <[email protected]>
2019-09-18Merge pull request #219 from cfromknecht/fix-modv1.0.5-rc1v1.0.5Mitch Connors
Remove require pflag v1.0.3
2019-09-17Remove require pflag v1.0.3Conner Fromknecht
2019-09-17Fix typo in go.modv1.0.4Mitch Connors
2019-09-17Merge pull request #216 from therealmitchconnors/elegantMitch Connors
Implement SliceValue for better list semantics
2019-09-10gofmttherealmitchconnors
2019-09-10Add SliceValue Commentstherealmitchconnors
2019-09-05Expand SliceValue support to all slice and array types.therealmitchconnors
2019-08-16Add first SliceValue implementationstherealmitchconnors