MCPcopy Index your code
hub / github.com/cli/cli / listRun

Function listRun

pkg/cmd/alias/list/list.go:42–58  ·  view source on GitHub ↗
(opts *ListOptions)

Source from the content-addressed store, hash-verified

40}
41
42func listRun(opts *ListOptions) error {
43 cfg, err := opts.Config()
44 if err != nil {
45 return err
46 }
47
48 aliasCfg := cfg.Aliases()
49
50 aliasMap := aliasCfg.All()
51
52 if len(aliasMap) == 0 {
53 return cmdutil.NewNoResultsError("no aliases configured")
54 }
55
56 enc := yaml.NewEncoder(opts.IO.Out)
57 return enc.Encode(aliasMap)
58}

Callers 1

NewCmdListFunction · 0.70

Calls 4

NewNoResultsErrorFunction · 0.92
ConfigMethod · 0.65
AliasesMethod · 0.65
AllMethod · 0.65

Tested by

no test coverage detected