mirror of
https://github.com/spf13/cobra
synced 2025-05-05 21:07:24 +00:00
cache command name
This commit is contained in:
parent
35136c09d8
commit
a04b678370
1 changed files with 2 additions and 1 deletions
|
@ -969,7 +969,8 @@ func (c *Command) Name() string {
|
||||||
if i >= 0 {
|
if i >= 0 {
|
||||||
name = name[:i]
|
name = name[:i]
|
||||||
}
|
}
|
||||||
return name
|
c.name = name
|
||||||
|
return c.name
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasAlias determines if a given string is an alias of the command.
|
// HasAlias determines if a given string is an alias of the command.
|
||||||
|
|
Loading…
Add table
Reference in a new issue