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

Copying flags #340

Open jzelinskie opened 2 years ago

jzelinskie commented 2 years ago

There are use cases for testing or re-using flags from other programs where you actually want to copy flags from a flagset into a new one and not simply add it. There are lots of private fields that make this difficult/impossible with the existing API.