MCPcopy Create free account
hub / github.com/cli/cli / init

Function init

internal/docs/docs_test.go:12–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10func emptyRun(*cobra.Command, []string) {}
11
12func init() {
13 rootCmd.PersistentFlags().StringP("rootflag", "r", "two", "")
14 rootCmd.PersistentFlags().StringP("strtwo", "t", "two", "help message for parent flag strtwo")
15
16 echoCmd.PersistentFlags().StringP("strone", "s", "one", "help message for flag strone")
17 echoCmd.PersistentFlags().BoolP("persistentbool", "p", false, "help message for flag persistentbool")
18 echoCmd.Flags().IntP("intone", "i", 123, "help message for flag intone")
19 echoCmd.Flags().BoolP("boolone", "b", true, "help message for flag boolone")
20
21 timesCmd.PersistentFlags().StringP("strtwo", "t", "2", "help message for child flag strtwo")
22 timesCmd.Flags().IntP("inttwo", "j", 234, "help message for flag inttwo")
23 timesCmd.Flags().BoolP("booltwo", "c", false, "help message for flag booltwo")
24
25 printCmd.PersistentFlags().StringP("strthree", "s", "three", "help message for flag strthree")
26 printCmd.Flags().IntP("intthree", "i", 345, "help message for flag intthree")
27 printCmd.Flags().BoolP("boolthree", "b", true, "help message for flag boolthree")
28
29 jsonCmd.Flags().StringSlice("json", nil, "help message for flag json")
30
31 aliasCmd.Flags().StringSlice("yang", nil, "help message for flag yang")
32
33 echoCmd.AddCommand(timesCmd, echoSubCmd, deprecatedCmd)
34 rootCmd.AddCommand(printCmd, echoCmd, dummyCmd)
35}
36
37var rootCmd = &cobra.Command{
38 Use: "root",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected