INNER CODE UNIT · Go

newCLIListCommand

ktr0731/evans · app/cli_commands.go:67

func newCLIListCommand(flags *flags, ui cui.UI) *cobra.Command {
	var (
		out string
	)
	cmd := &cobra.Command{
		Use:     "list [options ...] [fully-qualified service/method name]",
		Aliases: []string{"ls", "show"},
		Short:   "list services or methods",
		Long: `list provides listing feature against to gRPC services or methods belong to a service.
If a fully-qualified service name (in the form of <package name>.<service name>),
list lists method names belong to the service. If not, list lists all services.`,
		Example: strings.Join([]string{
			"        $ evans -r cli list             # list all services",
			"        $ evans -r cli list -o json     # list all services with JSON format",
			`        $ evans -r cli list api.Service # list all methods belong to service "api.Service"`,
		}, "\n"),
		RunE: runFunc(flags, func(cmd *cobra.Command, cfg *mergedConfig) error {
			if cfg.REPL.ColoredOutput {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…