forked from ogier/pflag
-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add exported functions to preserve
pkg/flag
compatibility (#220)
* Rename out() to Output() This brings behavior inline with go's flag library, and allows for printing output directly to whatever the current FlagSet is using for output. This change will make it easier to correctly emit output to stdout or stderr (e.g. a user has requested a help screen, which should emit to stdout since it's the desired outcome). * improve compat. with pkg/flag by adding Name() pkg/flag has a public `Name()` function, which returns the name of the flag set when called. This commit adds that function, as well as a test for it. * Streamline testing Name() Testing `Name()` will move into its own explicit test, instead of running inline during `TestAddFlagSet()`. Co-authored-by: Chloe Kudryavtsev <toast@toast.cafe> Co-authored-by: Chloe Kudryavtsev <toast@toast.cafe>
- Loading branch information
Showing
2 changed files
with
39 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters