summaryrefslogtreecommitdiff
path: root/parse.go
AgeCommit message (Collapse)Author
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-30required positional argsMario 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-15put comment backAlex Flint
2017-02-15use go-scalar, vendoringAlex Flint
2017-02-09fix case where os.Args is emptyAlex Flint
2017-01-23add support for description stringEmmanouil "Manolis" Maragkakis
2016-10-10add support for embedded structsAlex Flint
2016-09-08add support for version stringAlex 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-23add support for IP address, email address, and MAC addressAlex Flint
2016-01-23add support for pointers and TextUnmarshalerAlex 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-22Merge pull request #13 from walle/show_builtinAlex Flint
Add built ins to options in help output
2015-11-16Add built ins to options in help outputFredrik Wallgren
Adds help to the options in help output with an easy way to add more built ins.
2015-11-11Move package documentation to doc.goFredrik Wallgren
2015-11-04add more testsAlex Flint
2015-11-01fix first example in docs - h/t eric somerladeAlex Flint
2015-11-01separate help into WriteUsage and WriteHelpAlex Flint
2015-11-01add .travis.ymlAlex Flint
2015-11-01fix exampleAlex Flint
2015-11-01added runnable examplesAlex Flint
2015-11-01move more stuff over to the parser structAlex Flint
2015-10-31added parser structAlex Flint
2015-10-31udpate readmeAlex Flint
2015-10-31added usage generationAlex Flint
2015-10-31positional arguments workingAlex Flint
2015-10-31basic first version workingAlex Flint