mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
cache command name (#390)
This commit is contained in:
parent
99600f6874
commit
b5d8e8f46a
1 changed files with 2 additions and 1 deletions
|
@ -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 a new issue