Cleaned up exported func comments per golint

This commit is contained in:
Matt Farina
2016-05-09 10:12:59 -04:00
parent 2f4ec31264
commit 2f110bd745
8 changed files with 103 additions and 63 deletions

View File

@@ -56,7 +56,7 @@ type Command struct {
commandNamePath []string
}
// Returns the full name of the command.
// FullName returns the full name of the command.
// For subcommands this ensures that parent commands are part of the command path
func (c Command) FullName() string {
if c.commandNamePath == nil {
@@ -65,9 +65,10 @@ func (c Command) FullName() string {
return strings.Join(c.commandNamePath, " ")
}
// Commands is a slice of Command
type Commands []Command
// Invokes the command given the context, parses ctx.Args() to generate command-specific flags
// Run invokes the command given the context, parses ctx.Args() to generate command-specific flags
func (c Command) Run(ctx *Context) (err error) {
if len(c.Subcommands) > 0 {
return c.startApp(ctx)
@@ -191,6 +192,7 @@ func (c Command) Run(ctx *Context) (err error) {
return err
}
// Names returns the names including short names and aliases.
func (c Command) Names() []string {
names := []string{c.Name}
@@ -201,7 +203,7 @@ func (c Command) Names() []string {
return append(names, c.Aliases...)
}
// Returns true if Command.Name or Command.ShortName matches given name
// HasName returns true if Command.Name or Command.ShortName matches given name
func (c Command) HasName(name string) bool {
for _, n := range c.Names() {
if n == name {