Example #1
0
func publish(ctx *cli.Context) error {
	argv := ctx.Argv().(*publishT)
	if argv.List {
		ctx.String(ctx.Command().ChildrenDescriptions("", "    "))
		return nil
	}
	ctx.String("%s: %v", ctx.Path(), jsonIndent(argv))
	return nil
}
Example #2
0
File: main.go Project: suntong/lang
func gogo(ctx *cli.Context) error {
	argv := ctx.Argv().(*gogoT)
	if argv.Version {
		ctx.String(version + "\n")
		return nil
	}

	if argv.List {
		ctx.String(ctx.Command().ChildrenDescriptions(" ", "  =>  "))
		return nil
	}

	ctx.String("try `%s --help for more information'\n", ctx.Path())
	return nil
}