aboutsummaryrefslogtreecommitdiff
path: root/flag.go
AgeCommit message (Collapse)Author
2015-05-10Call normalizeFlagName function only onceAnastasis Andronidis
2015-05-08Support bool= with shortnamesEric Paris
Currently a shortname bool variable b cannot use the -b=true -b=false form because the -b is assumed to mean true and the = format is never noticed.
2015-05-08Rewrite short arg parsing for readabilityEric Paris
new function to parse each arg (less indentation) make it clear what value is being set and where it came from
2015-05-08parseLongArg code rework for readabilityEric Paris
move the -- parsing up into the parent make it more obvious which values we are using
2015-04-28Custom normalization funcEric Paris
This can be used however you want. My test is for flag aliases
2015-04-28Make normalizedName external so we can make the functions externalEric Paris
2015-04-28Ability to mark flags as deprecatedEric Paris
They will not show up in usage or help, but they will still work. The usage message will print on os.Stderr any time the flag is set.
2015-04-27Merge pull request #10 from eparis/declare_by_nameEric Paris
Declare Flag{ by name instead of order
2015-04-27Merge pull request #12 from fabianofranz/masterEric Paris
Add support to short form with equal sign: -p=value
2015-04-23Allow WordSeparators to be set after flags are addedTim Hockin
2015-04-24Allow flag name normalization for compareTim Hockin
This allows the FlagSet to define equivalent word-separators. Given this, one can make - and _ equivalent, so --foo-bar and --foo_bar both work.
2015-04-22Add support to short form with equal sign: -p=valuefabianofranz
2015-04-07Declare Flag{ by name instead of orderEric Paris
In order to be able to add new (unitialized) fields to Flags{} declare fields by name instead of order
2015-04-01add annotations for flagsEric Paris
cobra.Command can make use of annotation in order to generate better bash_completions
2015-03-12Always return when err is not nil.Brendan Burns
2015-02-17Fix handling of -- terminationAndy Goldstein
Fix handling of -- termination. Previously, if you ran $command -flag1 -etc -- some args after the command's args would be doubled (some args after some args after). Additionally, if there were items after the -- termination that looked like flags, the parser would throw an error. It's better to terminate parsing when -- is seen, because that usually indicates the caller wants to pass the remainder of the arguments (including flags) as-is to something else.
2015-01-16Add support for custom boolean flags through IsBoolFlag()Filipe Brandenburger
This is consistent with Go's native flag parsing module and can be used to implement custom boolean/tri-state flags. Signed-off-by: Filipe Brandenburger <[email protected]>
2014-07-11Adding Type() method to the values.spf13
2014-06-27Moving Value interface to the appropriate filespf13
2014-06-27Fixing issues so test pass againspf13
2014-06-27Merge branch 'master' of https://github.com/ogier/pflagspf13
Conflicts: flag.go
2014-04-02Compatibility: commandLine -> CommandLineAlec Thomas
2014-03-17More data types. Each in a separate file.Riobard
2014-03-16Make reuse message more clearJohannes Schickling
2013-11-12adding changed flag on flag to track user set vs defaultspf13
2013-11-05Fixing bug where invalid trailing short flag would cause panicspf13
2013-09-24cleaning up and adding some functionality needed by cobraspf13
2012-12-20Merge pull request #2 from alecthomas/masterAlex Ogier
Add ability to disable interspersed option support.
2012-12-20Fix comment.Alec Thomas
2012-12-20Set interspersed behaviour via a setter.Alec Thomas
2012-12-19Add support for non-interspersed option/non-option args.Alec Thomas
2012-12-19Add missing VarP function for the default command lineAlex Ogier
2012-12-19Merge changes from Go's standard flag library.Alex Ogier
Up to date through e7cd0a82d669. Relevant changesets: https://code.google.com/p/go/source/detail?r=059ba0d0dc6a27d115c619ff8bcd646335eed67f https://code.google.com/p/go/source/detail?r=64a249c65d510184268160bf595cf3db478a296e https://code.google.com/p/go/source/detail?r=6ca4825bc86760d43392469c0af266bb858fc77b
2012-05-09Tighten up parsing to be less ambiguous, follow GNU conventionsAlex Ogier
2012-05-09Add READMEAlex Ogier
2012-05-07Formatted with go fmtAlex Ogier
2012-05-04Fix up pflag's usage documentation, and reference GNU specAlex Ogier
2012-05-04s/shortcut/shorthand/Alex Ogier
2012-05-04Document the spaceless shortcut argument format -IfileAlex Ogier
2012-05-04Print defaults with nice spacing regardless of shortcutsAlex Ogier
2012-05-04Update package documentation for POSIX-style flagsAlex Ogier
2012-05-04Nicer error message for undefined flagsAlex Ogier
2012-04-30Mark flags as visited based on their nameAlex Ogier
2012-04-30Rename package flag --> pflagAlex Ogier
2012-04-30Oops, allocate memory for arguments, don't set them to ""Alex Ogier
2012-04-30Allow -Ifile, -n3 style shorthandAlex Ogier
2012-04-30Print out usage in the proper POSIX formatAlex Ogier
2012-04-30Modify flag parser to handle -shortcut and long --optionsAlex Ogier
2012-04-26Add Shortcut field to Flag, and *P() versions of flags that take shortcutsAlex Ogier
2012-04-26Copy the flag module from the go standard libraryAlex Ogier