-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
CalledAs
method to cobra.Command (w/ tests) (#567)
* Add `CalledAs` method to Command (w/ tests) The `CalledAs` method returns the name of the command or alias that invoked the command -- as long as the command was actually invoked. Otherwise, it returns the empty string. The opens up possibilies for commands to behave differently based on which alias invoked the command (in the same vein as Linux programs which adjust their behavior based on the value of argv[0]). * Fixed formatting
- Loading branch information
Showing
2 changed files
with
86 additions
and
0 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