Example #1
0
func (cmd Greet) Execute(ctx *cli.Context) error {
	terminal.Debug("Greet %v", ctx.Args())

	var name string

	if len(ctx.Args()) == 0 {
		name = terminal.Ask(T("Input name"))
	} else if len(ctx.Args()) == 1 {
		name = ctx.Args()[0]
	} else {
		terminal.FailWithUsage(ctx)
	}

	if ctx.String("lang") == "Spanish" {
		terminal.Say("Hola %s", name)
	} else {
		terminal.Say("Hello %s", name)
	}

	return nil
}
Example #2
0
func printCrashDialog(errorMessage string, commandArgs string, stackTrace string) {
	terminal.Say(crashDialog(errorMessage, commandArgs, stackTrace))
}