MCPcopy
hub / github.com/cli/cli / AddJSONFlagsWithoutShorthand

Function AddJSONFlagsWithoutShorthand

pkg/cmdutil/json_flags.go:35–42  ·  view source on GitHub ↗
(cmd *cobra.Command, exportTarget *Exporter, fields []string)

Source from the content-addressed store, hash-verified

33}
34
35func AddJSONFlagsWithoutShorthand(cmd *cobra.Command, exportTarget *Exporter, fields []string) {
36 f := cmd.Flags()
37 addJsonFlag(f)
38 addJqFlag(f, "")
39 addTemplateFlag(f, "")
40
41 setupJsonFlags(cmd, exportTarget, fields)
42}
43
44func addJsonFlag(f *pflag.FlagSet) {
45 f.StringSlice("json", nil, "Output JSON with the specified `fields`")

Callers 2

NewCmdStatusFunction · 0.92

Calls 4

addJsonFlagFunction · 0.85
addJqFlagFunction · 0.85
addTemplateFlagFunction · 0.85
setupJsonFlagsFunction · 0.85

Tested by 1