summaryrefslogtreecommitdiff
path: root/parse_test.go
AgeCommit message (Collapse)Author
2021-01-31Merge remote-tracking branch 'origin/master' into optional-longAlex Flint
2021-01-31skip unexported fieldsAlex Flint
2020-12-20Optional long argumentsAndrew Morozko
2020-03-01add Config.IgnoreEnv to ignore environment variablesAlex Flint
2020-01-24add a further testAlex Flint
2020-01-24fix issue with duplicate fields in embedded structsAlex Flint
2019-11-30Various changesAndrew Morozko
2019-10-19store default values during NewParserAlex Flint
2019-10-08add support for default values in struct tagsAlex Flint
2019-10-04fix issue 89 (multiple args terminated by "--")Alex Flint
2019-08-06fix commentAlex Flint
2019-05-03no need to initialize nil structs during path traversalAlex Flint
2019-05-03add Parser.Subcommand and Parser.SubcommandNamesAlex Flint
2019-05-02test use of --versionAlex Flint
2019-05-02use backticks rather than backslashes in string literalAlex Flint
2019-05-02add test for case where environment var is not presentAlex Flint
2019-05-02add test case for missing value in middle of argument stringAlex Flint
2019-04-30add recursive expansion of subcommandsAlex Flint
2019-04-30check error in testAlex Flint
2019-04-14refactor validationAlex Flint
2019-04-04add golangci badge, and fix some lint issues found by the toolAlex Flint
2018-11-20parse_test: add tests covering new TextUnamarshaler value supportPavel Borzenkov
Signed-off-by: Pavel Borzenkov <[email protected]>
2018-11-20parse_test: fix formattingPavel Borzenkov
Signed-off-by: Pavel Borzenkov <[email protected]>
2018-05-14Fix the problem with errorsIllia Volochii
2018-05-01Change format from JSON to CSVIllia Volochii
2018-04-26Add one more testIllia Volochii
2018-04-26Fix providing multiple values via environment variablesIllia Volochii
2018-04-18add positional testAlex Flint
2018-04-18drop setScalarAlex Flint
2018-01-13handle negative valuesAlex Flint
2017-10-02Altered help tag parsing to reduce the constraints on help text content; old ↵Rick
behaviour is retained for backward compatibility
2017-09-16Allow spaces after each comma in tagsRick
2017-03-30testsMario Hros
2017-03-04Adding separate tag optionKenneth Shaw
As outlined in #49, there is a need to mimic the behavior of other applications by interweaving positional and non-positional parameters. This change adds the 'separate' option that will force a arg of type []string to only read the next supplied value. For example, when dealing with the following arg type: var MyArgs struct { Pos []string `arg:"positional"` Separate []string `arg:"-s,separate"` } This commit will parse the following command line: ./app pos1 pos2 -s=separate1 -s=separate2 pos3 -s=separate3 pos4 Such that MyArgs.Pos will be [pos1 pos2 pos3 pos4] and MyArgs.Separate will be [separate1 separate2 separate3]. Unit tests for the above have also been written and are included in this commit, as well as the addition of a section to README.md and an example func in example_test.go. Fixes #49
2017-02-21deal with "-" as option valueAlex Flint
2017-02-15deal with booleans correctlyAlex Flint
2017-02-09fix case where os.Args is emptyAlex Flint
2016-10-10add support for embedded structsAlex Flint
2016-07-31fix example function namesAlex Flint
2016-02-29Allow override of defaults for slice argumentsFredrik Wallgren
This commit fixes a bug where if a multiple value argument (slice) has default values, the submitted values will be appended to the default. Not overriding them as expected.
2016-02-22Merge pull request #32 from alexflint/override_program_nameAlex Flint
make it possible to override the name of the program
2016-01-23added tests for MAC and email addressesAlex Flint
2016-01-23added tests for IP address parsingAlex Flint
2016-01-23add support for pointers and TextUnmarshalerAlex Flint
2016-01-23add test for invalid durationsAlex Flint
2016-01-23add support for time.Duration fieldsAlex Flint
2016-01-18Add support for environment variablesbrettlangdon
2016-01-18make it possible to override the name of the programAlex Flint
2016-01-05MustParse returns *ParserAlex Flint
2015-11-04add more testsAlex Flint