mirror of
https://github.com/spf13/cobra.git
synced 2024-11-15 09:48:19 -07:00
cache command name (#390)
This commit is contained in:
parent
99600f6874
commit
b5d8e8f46a
@ -972,7 +972,8 @@ func (c *Command) Name() string {
|
||||
if i >= 0 {
|
||||
name = name[:i]
|
||||
}
|
||||
return name
|
||||
c.name = name
|
||||
return c.name
|
||||
}
|
||||
|
||||
// HasAlias determines if a given string is an alias of the command.
|
||||
|
Loading…
Reference in New Issue
Block a user