| Age | Commit message (Collapse) | Author |
|
This is useful for programs which want to define some flags with pflag (for
example, in external packages) but still need to use Go flag command line
parsing to preserve backward compatibility with previous releases, in
particular support for single-dash flags.
Without this in pflag, such tools have to resort to copying via the public
API, which leads to less useful help messages (type of basic values
will be unknown).
|
|
test flags.
|
|
* make GoFlagSets.Parsed() true after pflag.Parse
some third part lib such as glog use go flag package, and its some
actions depends on if goflag.Parsed().
* add test case for goflag.CommandLine.Parsed()
* add comment to goflag.CommandLine.Parsed test case
|
|
|
|
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.
|
|
|
|
Apparently it is wrong :-(. Use the current value instead. It is at
least the default at the moment that pflag learned about the flag.
|
|
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`.
|