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

Function NewCmdConfig

pkg/cmd/config/config.go:16–45  ·  view source on GitHub ↗
(f *cmdutil.Factory)

Source from the content-addressed store, hash-verified

14)
15
16func NewCmdConfig(f *cmdutil.Factory) *cobra.Command {
17 longDoc := strings.Builder{}
18 longDoc.WriteString("Display or change configuration settings for gh.\n\n")
19 longDoc.WriteString("Current respected settings:\n")
20 for _, co := range config.Options {
21 longDoc.WriteString(fmt.Sprintf("- `%s`: %s", co.Key, co.Description))
22 if len(co.AllowedValues) > 0 {
23 longDoc.WriteString(fmt.Sprintf(" `{%s}`", strings.Join(co.AllowedValues, " | ")))
24 }
25 if co.DefaultValue != "" {
26 longDoc.WriteString(fmt.Sprintf(" (default `%s`)", co.DefaultValue))
27 }
28 longDoc.WriteRune('\n')
29 }
30
31 cmd := &cobra.Command{
32 Use: "config <command>",
33 Short: "Manage configuration for gh",
34 Long: longDoc.String(),
35 }
36
37 cmdutil.DisableAuthCheck(cmd)
38
39 cmd.AddCommand(cmdGet.NewCmdConfigGet(f, nil))
40 cmd.AddCommand(cmdSet.NewCmdConfigSet(f, nil))
41 cmd.AddCommand(cmdList.NewCmdConfigList(f, nil))
42 cmd.AddCommand(cmdClearCache.NewCmdConfigClearCache(f, nil))
43
44 return cmd
45}

Callers

nothing calls this directly

Calls 3

DisableAuthCheckFunction · 0.92
JoinMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected