HasAlias determines if a given string is an alias of the command.
(s string)
| 1549 | |
| 1550 | // HasAlias determines if a given string is an alias of the command. |
| 1551 | func (c *Command) HasAlias(s string) bool { |
| 1552 | for _, a := range c.Aliases { |
| 1553 | if commandNameMatches(a, s) { |
| 1554 | return true |
| 1555 | } |
| 1556 | } |
| 1557 | return false |
| 1558 | } |
| 1559 | |
| 1560 | // CalledAs returns the command name or alias that was used to invoke |
| 1561 | // this command or an empty string if the command has not been called. |
no test coverage detected