Name returns the command's name: the first word in the use line.
()
| 778 | |
| 779 | // Name returns the command's name: the first word in the use line. |
| 780 | func (c *Command) Name() string { |
| 781 | if c.name != "" { |
| 782 | return c.name |
| 783 | } |
| 784 | name := c.Use |
| 785 | i := strings.Index(name, " ") |
| 786 | if i >= 0 { |
| 787 | name = name[:i] |
| 788 | } |
| 789 | return name |
| 790 | } |
| 791 | |
| 792 | // Determine if a given string is an alias of the command. |
| 793 | func (c *Command) HasAlias(s string) bool { |
no outgoing calls