Name returns the command's name: the first word in the use line.
()
| 1539 | |
| 1540 | // Name returns the command's name: the first word in the use line. |
| 1541 | func (c *Command) Name() string { |
| 1542 | name := c.Use |
| 1543 | i := strings.Index(name, " ") |
| 1544 | if i >= 0 { |
| 1545 | name = name[:i] |
| 1546 | } |
| 1547 | return name |
| 1548 | } |
| 1549 | |
| 1550 | // HasAlias determines if a given string is an alias of the command. |
| 1551 | func (c *Command) HasAlias(s string) bool { |
no outgoing calls