Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbourgon committed Aug 29, 2023
1 parent 215e25d commit 8cbce4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion command.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (cmd *Command) ParseAndRun(ctx context.Context, args []string, options ...O
}

// GetSelected returns the terminal command selected during the parse phase, or
// nil if the command hasn't been parsed.
// nil if the command hasn't been successfully parsed.
func (cmd *Command) GetSelected() *Command {
if cmd.selected == nil {
return nil
Expand Down
13 changes: 6 additions & 7 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
)

var (
// ErrHelp should be returned by the parse method of flag sets, when the
// provided args indicate the user has requested help. Usually this means
// -h or --help was one of the args.
// ErrHelp should be returned by flag sets during parse, when the provided
// args indicate the user has requested help.
ErrHelp = flag.ErrHelp

// ErrDuplicateFlag should be returned by flag sets when the user tries to
Expand All @@ -24,10 +23,10 @@ var (
// again.
ErrAlreadyParsed = errors.New("already parsed")

// ErrNoExec is returned when a command without an exec function is run.
ErrNoExec = errors.New("no exec function")

// ErrUnknownFlag should be returned by flag sets methods to indicate that a
// specific or user-requested flag could not be found.
// specific or user-requested flag was provided but could not be found.
ErrUnknownFlag = errors.New("unknown flag")

// ErrNoExec is returned when a command without an exec function is run.
ErrNoExec = errors.New("no exec function")
)

0 comments on commit 8cbce4e

Please sign in to comment.