MCPcopy
hub / github.com/cli/cli / listRun

Function listRun

pkg/cmd/config/list/list.go:45–63  ·  view source on GitHub ↗
(opts *ListOptions)

Source from the content-addressed store, hash-verified

43}
44
45func listRun(opts *ListOptions) error {
46 cfg, err := opts.Config()
47 if err != nil {
48 return err
49 }
50
51 var host string
52 if opts.Hostname != "" {
53 host = opts.Hostname
54 } else {
55 host, _ = cfg.Authentication().DefaultHost()
56 }
57
58 for _, option := range config.Options {
59 fmt.Fprintf(opts.IO.Out, "%s=%s\n", option.Key, option.CurrentValue(cfg, host))
60 }
61
62 return nil
63}

Callers 2

Test_listRunFunction · 0.70
NewCmdConfigListFunction · 0.70

Calls 3

ConfigMethod · 0.65
DefaultHostMethod · 0.65
AuthenticationMethod · 0.65

Tested by 1

Test_listRunFunction · 0.56