spf13 / pflag

Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
BSD 3-Clause "New" or "Revised" License
2.43k stars 348 forks source link

implement CopyToGoFlagSet #330

Open pohly opened 3 years ago

pohly commented 3 years ago

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.

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).

Fixes: https://github.com/spf13/pflag/issues/329

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.