entry: Execute embedded commands if you use their correct name
I think this is the more intuitive way to do things. Force the user the explicitly choose the embedded command which prevents accidental running of a different command, and allows us to potentially have multiple commands in the future.
This commit is contained in:
@@ -170,6 +170,12 @@ type Runner struct {
|
||||
data *Data
|
||||
}
|
||||
|
||||
// Name returns the name of the program, which should match the argv[1] of what
|
||||
// we want to use to call this from the top-level main.
|
||||
func (obj *Runner) Name() string {
|
||||
return obj.data.Program
|
||||
}
|
||||
|
||||
// CLI is the entry point for using any embedded package from the CLI. It is
|
||||
// used as the main entry point from the top-level main function and kicks-off
|
||||
// the CLI parser.
|
||||
|
||||
Reference in New Issue
Block a user