Lines Matching refs:rootCmd

39 	rootCmd := &Command{
69 rootCmd.AddCommand(childCmd1, childCmd2, hiddenCmd, deprecatedCmd, aliasedCmd)
72 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
91 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "s")
107 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "test")
121 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "")
141 rootCmd := &Command{
145 rootCmd.Flags().String("localroot", "", "local root flag")
153 rootCmd.AddCommand(childCmd1)
166 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "childCmd1", "arg1", "")
180 …output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "childCmd1", "--nonPersistent", "…
197 rootCmd.TraverseChildren = true
199 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--localroot", "value", "")
204 rootCmd.TraverseChildren = false
219 rootCmd.TraverseChildren = true
221 …output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--localroot", "value", "childCmd…
226 rootCmd.TraverseChildren = false
241 …output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--localroot", "value", "childCmd…
255 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "childCmd1", "-n", "value", "")
271 …output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "childCmd1", "--persistent", "val…
288 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "childCmd1", "-p", "value", "")
306 rootCmd := &Command{
313 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
330 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "o")
345 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "one", "")
360 rootCmd := &Command{
371 rootCmd.AddCommand(childCmd)
374 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
393 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "t")
410 rootCmd := &Command{
422 rootCmd.AddCommand(childCmd)
425 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
444 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "t")
460 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "t")
477 rootCmd := &Command{
485 rootCmd.AddCommand(childCmd)
487 rootCmd.Flags().IntP("first", "f", -1, "first flag")
488 rootCmd.PersistentFlags().BoolP("second", "s", false, "second flag")
492 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
509 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-")
527 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--f")
542 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "childCmd", "-")
560 rootCmd := &Command{
569 rootCmd.AddCommand(childCmd)
571 rootCmd.Flags().IntP("first", "f", -1, "first flag\nlonger description for flag")
572 rootCmd.PersistentFlags().BoolP("second", "s", false, "second flag")
576 output, err := executeCommand(rootCmd, ShellCompRequestCmd, "")
593 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "-")
611 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "--f")
626 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "childCmd", "-")
644 rootCmd := &Command{
653 rootCmd.AddCommand(childCmd)
655 rootCmd.Flags().IntP("first", "f", -1, "first flag")
656 firstFlag := rootCmd.Flags().Lookup("first")
657 rootCmd.Flags().BoolP("second", "s", false, "second flag")
658 secondFlag := rootCmd.Flags().Lookup("second")
659 rootCmd.Flags().StringArrayP("array", "a", nil, "array flag")
660 arrayFlag := rootCmd.Flags().Lookup("array")
661 rootCmd.Flags().IntSliceP("slice", "l", nil, "slice flag")
662 sliceFlag := rootCmd.Flags().Lookup("slice")
663 rootCmd.Flags().BoolSliceP("bslice", "b", nil, "bool slice flag")
664 bsliceFlag := rootCmd.Flags().Lookup("bslice")
667 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--first", "1", "--")
687 …output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--first", "1", "--second=false",…
707 …output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--slice", "1", "--slice=2", "--a…
730 …output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-l", "1", "-l=2", "-a", "val", "…
757 …output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-l", "1", "-l=2", "-a", "val", "…
776 rootCmd := &Command{
788 rootCmd.AddCommand(childCmd)
790 rootCmd.Flags().IntP("requiredFlag", "r", -1, "required flag")
791 assertNoErr(t, rootCmd.MarkFlagRequired("requiredFlag"))
792 requiredFlag := rootCmd.Flags().Lookup("requiredFlag")
794 rootCmd.PersistentFlags().IntP("requiredPersistent", "p", -1, "required persistent")
795 assertNoErr(t, rootCmd.MarkPersistentFlagRequired("requiredPersistent"))
796 requiredPersistent := rootCmd.PersistentFlags().Lookup("requiredPersistent")
798 rootCmd.Flags().StringP("release", "R", "", "Release name")
805 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
827 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-")
845 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--relea")
860 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "childCmd", "")
878 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "childCmd", "-")
895 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "childCmd", "--subNot")
910 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--requiredFlag", "1", "")
929 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--requiredPersistent", "1", "")
951 …output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--requiredFlag", "1", "--require…
970 rootCmd := &Command{
976 rootCmd.Flags().StringP("file", "f", "", "file flag")
977 assertNoErr(t, rootCmd.MarkFlagFilename("file"))
980 rootCmd.Flags().StringP("log", "l", "", "log flag")
981 assertNoErr(t, rootCmd.MarkFlagFilename("log", "log"))
984 rootCmd.Flags().StringP("yaml", "y", "", "yaml flag")
985 assertNoErr(t, rootCmd.MarkFlagFilename("yaml", "yaml", "yml"))
988 rootCmd.Flags().StringP("text", "t", "", "text flag")
989 assertNoErr(t, rootCmd.Flags().SetAnnotation("text", BashCompFilenameExt, []string{"txt"}))
993 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--file", "")
1006 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--log", "")
1020 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--yaml", "")
1034 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--yaml=")
1048 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-y", "")
1062 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-y=")
1076 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--text", "")
1092 rootCmd := &Command{
1098 rootCmd.Flags().StringP("dir", "d", "", "dir flag")
1099 assertNoErr(t, rootCmd.MarkFlagDirname("dir"))
1102 rootCmd.Flags().StringP("subdir", "s", "", "subdir")
1103 assertNoErr(t, rootCmd.Flags().SetAnnotation("subdir", BashCompSubdirsInDir, []string{"themes"}))
1106 rootCmd.Flags().StringP("manydir", "m", "", "manydir")
1107 …assertNoErr(t, rootCmd.Flags().SetAnnotation("manydir", BashCompSubdirsInDir, []string{"themes", "…
1111 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--dir", "")
1124 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-d", "")
1137 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--subdir", "")
1151 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--subdir=")
1165 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-s", "")
1179 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-s=")
1193 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--manydir", "")
1220 rootCmd := &Command{
1229 rootCmd.AddCommand(childCmd)
1235 …_, output, err := executeCommandWithContextC(ctx, rootCmd, ShellCompNoDescRequestCmd, "childCmd", …
1250 rootCmd := &Command{
1257 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
1273 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "t")
1289 rootCmd := &Command{
1301 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "unexpectedArg", "t")
1316 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
1327 rootCmd.AddCommand(child1Cmd, child2Cmd)
1330 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "child1", "")
1346 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "child1", "t")
1361 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "child1", "unexpectedArg", "t")
1375 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "child2", "")
1390 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "child2", "t")
1405 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "child2", "unexpectedArg", "t")
1420 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
1427 rootCmd.AddCommand(child)
1430 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "son", "")
1446 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "daughter", "t")
1461 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "son", "unexpectedArg", "t")
1476 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
1482 rootCmd.AddCommand(child)
1485 assertNoErr(t, rootCmd.GenBashCompletion(buf))
1492 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
1497 rootCmd.AddCommand(child)
1500 assertNoErr(t, rootCmd.GenBashCompletion(buf))
1507 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
1513 rootCmd.AddCommand(child)
1516 assertNoErr(t, rootCmd.GenBashCompletion(buf))
1523 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
1529 rootCmd.AddCommand(child)
1532 assertNoErr(t, rootCmd.GenZshCompletionNoDesc(buf))
1539 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
1545 rootCmd.AddCommand(child)
1548 assertNoErr(t, rootCmd.GenZshCompletion(buf))
1556 rootCmd := &Command{
1560 rootCmd.Flags().IntP("introot", "i", -1, "help message for flag introot")
1561 …assertNoErr(t, rootCmd.RegisterFlagCompletionFunc("introot", func(cmd *Command, args []string, toC…
1570 rootCmd.Flags().String("filename", "", "Enter a filename")
1571 …assertNoErr(t, rootCmd.RegisterFlagCompletionFunc("filename", func(cmd *Command, args []string, to…
1582 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--introot", "")
1599 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--introot", "1")
1615 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--filename", "")
1632 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "--filename", "f")
1649 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
1660 rootCmd.AddCommand(child1Cmd, child2Cmd)
1663 output, err := executeCommand(rootCmd, ShellCompRequestCmd, "child1", "")
1679 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child1", "t")
1694 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child1", "unexpectedArg", "t")
1708 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child2", "")
1723 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child2", "t")
1738 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child2", "unexpectedArg", "t")
1753 rootCmd := &Command{Use: "root", Run: emptyRun}
1766 rootCmd.AddCommand(childCmd, childCmd2)
1774 output, err := executeCommand(rootCmd, ShellCompRequestCmd, "child", "--")
1790 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "--", "-")
1806 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "--bool", "--", "-")
1825 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "arg", "--")
1841 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "--string", "t", "arg", "--")
1857 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "--", "")
1873 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "--", "--string", "")
1889 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child2", "--", "a")
1905 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "--", "--validarg", "")
1921 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "arg", "--validarg", "")
1940 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "--", "--validarg", "")
1958 …output, err = executeCommand(rootCmd, ShellCompRequestCmd, "child", "--", "--validarg", "--toComp=…
1975 rootCmd := &Command{Use: "root", Run: emptyRun}
1991 rootCmd.AddCommand(childCmd)
1994 output, err := executeCommand(rootCmd, ShellCompRequestCmd, "child", "--string", "")
2010 rootCmd := &Command{
2014 rootCmd.Flags().IntP("introot", "i", -1, "help message for flag introot")
2015 …assertNoErr(t, rootCmd.RegisterFlagCompletionFunc("introot", func(cmd *Command, args []string, toC…
2024 rootCmd.Flags().String("filename", "", "Enter a filename")
2025 …assertNoErr(t, rootCmd.RegisterFlagCompletionFunc("filename", func(cmd *Command, args []string, to…
2036 output, err := executeCommand(rootCmd, ShellCompRequestCmd, "--introot", "")
2053 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "--introot", "1")
2069 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "--filename", "")
2086 output, err = executeCommand(rootCmd, ShellCompRequestCmd, "--filename", "f")
2103 rootCmd := &Command{
2114 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
2130 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "t")
2146 rootCmd := &Command{
2155 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
2172 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "t")
2188 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "tr")
2204 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
2213 rootCmd.AddCommand(child1Cmd, child2Cmd)
2222 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "")
2240 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "help", "")
2258 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "help", "child1", "")
2273 func removeCompCmd(rootCmd *Command) {
2275 for _, cmd := range rootCmd.commands {
2277 rootCmd.RemoveCommand(cmd)
2284 rootCmd := &Command{
2291 assertNoErr(t, rootCmd.Execute())
2292 for _, cmd := range rootCmd.commands {
2303 rootCmd.AddCommand(subCmd)
2307 assertNoErr(t, rootCmd.Execute())
2308 for _, cmd := range rootCmd.commands {
2318 removeCompCmd(rootCmd)
2321 rootCmd.CompletionOptions.DisableDefaultCmd = true
2322 assertNoErr(t, rootCmd.Execute())
2323 for _, cmd := range rootCmd.commands {
2330 rootCmd.CompletionOptions.DisableDefaultCmd = false
2333 output, err := executeCommand(rootCmd, compCmdName, "zsh")
2341 removeCompCmd(rootCmd)
2344 rootCmd.CompletionOptions.DisableDescriptions = true
2345 output, err = executeCommand(rootCmd, compCmdName, "zsh")
2352 rootCmd.CompletionOptions.DisableDescriptions = false
2354 removeCompCmd(rootCmd)
2358 assertNoErr(t, rootCmd.Execute())
2360 if compCmd, _, err = rootCmd.Find([]string{compCmdName, shell}); err != nil {
2368 removeCompCmd(rootCmd)
2371 rootCmd.CompletionOptions.DisableNoDescFlag = true
2372 assertNoErr(t, rootCmd.Execute())
2374 if compCmd, _, err = rootCmd.Find([]string{compCmdName, shell}); err != nil {
2382 rootCmd.CompletionOptions.DisableNoDescFlag = false
2384 removeCompCmd(rootCmd)
2387 rootCmd.CompletionOptions.DisableDescriptions = true
2388 assertNoErr(t, rootCmd.Execute())
2390 if compCmd, _, err = rootCmd.Find([]string{compCmdName, shell}); err != nil {
2398 rootCmd.CompletionOptions.DisableDescriptions = false
2400 removeCompCmd(rootCmd)
2404 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
2409 rootCmd.AddCommand(subCmd)
2412 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "completion", "")
2431 for _, cmd := range rootCmd.Commands() {
2439 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, compCmdName, shell.Name(), "")
2455 rootCmd := &Command{
2460 f := rootCmd.Flags()
2464 …_ = rootCmd.RegisterFlagCompletionFunc("short3", func(*Command, []string, string) ([]string, Shell…
2469 output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-s", "")
2485 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-sd", "")
2501 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-sdf", "")
2516 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-sdf=")
2531 output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, "-sdf=abc", "")