Download coderank/dumps/project_search-model-cobra.jsonl from paintedwolfcode/bialy-dataset: direct link, hf CLI and curl.
- Browser
- Download file 345 kB
-
https://huggingface.co/datasets/paintedwolfcode/bialy-dataset/resolve/main/coderank/dumps/project_search-model-cobra.jsonl
- Command line
-
hf download hf://datasets/paintedwolfcode/bialy-dataset/coderank/dumps/project_search-model-cobra.jsonl
-
curl -L -o project_search-model-cobra.jsonl https://huggingface.co/datasets/paintedwolfcode/bialy-dataset/resolve/main/coderank/dumps/project_search-model-cobra.jsonl
345 kB
| {"site":"project_search","repo":"cobra","task":"명령어 사용법 템플릿을 가져오는 함수를 찾아주세요. 현재 명령어에 사용자 정의 템플릿이 설정되어 있으면 그것을 사용하고, 부모 명령어가 있는 경우 재귀적으로 상위 명령어의 템플릿을 확인해야 합니다. 최종적으로 기본 템플릿 함수를 반환해야 합니다.","query":"usage template function","file":"command.go","symbol":"getUsageTemplateFunc","line":464,"lang":"ko","candidates":[{"text":"File: cobra.go\nLine 83: // AddTemplateFunc adds a template function that's available to Usage and Help","file":"cobra.go","line":83,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra.go\nLine 89: // AddTemplateFuncs adds multiple template functions that are available to Usage and","file":"cobra.go","line":89,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 462: // getUsageTemplateFunc returns the usage template function for the command","file":"command.go","line":462,"lexical":0.44999999999999996,"target":true},{"text":"File: site/content/user_guide.md\nLine 661: You can provide your own usage function or template for Cobra to use.","file":"site/content/user_guide.md","line":661,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"activehelp 전역 환경변수 명칭을 구성하는 상수 정의","query":"active help env var","file":"active_help.go","symbol":"activeHelpGlobalEnvVar","line":27,"lang":"ko","candidates":[{"text":"File: active_help.go\nLine 26: activeHelpEnvVarSuffix = \"ACTIVE_HELP\"","file":"active_help.go","line":26,"lexical":0.65,"target":true},{"text":"File: active_help.go\nLine 27: activeHelpGlobalEnvVar = configEnvVarGlobalPrefix + \"_\" + activeHelpEnvVarSuffix","file":"active_help.go","line":27,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 42: // GetActiveHelpConfig returns the value of the ActiveHelp environment variable","file":"active_help.go","line":42,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 45: // It will always return \"0\" if the global environment variable COBRA_ACTIVE_HELP","file":"active_help.go","line":45,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 48: activeHelpCfg := os.Getenv(activeHelpGlobalEnvVar)","file":"active_help.go","line":48,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 50: activeHelpCfg = os.Getenv(activeHelpEnvVar(cmd.Root().Name()))","file":"active_help.go","line":50,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 55: // activeHelpEnvVar returns the name of the program-specific ActiveHelp environment","file":"active_help.go","line":55,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 58: func activeHelpEnvVar(name string) string {","file":"active_help.go","line":58,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 59: return configEnvVar(name, activeHelpEnvVarSuffix)","file":"active_help.go","line":59,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 281: os.Setenv(activeHelpEnvVar(rootCmd.Name()), activeHelpCfg)","file":"active_help_test.go","line":281,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 299: os.Setenv(activeHelpEnvVar(rootCmd.Name()), activeHelpCfg)","file":"active_help_test.go","line":299,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 336: os.Setenv(activeHelpEnvVar(rootCmd.Name()), \"0\")","file":"active_help_test.go","line":336,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 348: os.Unsetenv(activeHelpEnvVar(rootCmd.Name()))","file":"active_help_test.go","line":348,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 361: os.Setenv(activeHelpGlobalEnvVar, \"0\")","file":"active_help_test.go","line":361,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 364: os.Setenv(activeHelpEnvVar(rootCmd.Name()), \"1\")","file":"active_help_test.go","line":364,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 383: os.Setenv(activeHelpGlobalEnvVar, \"on\")","file":"active_help_test.go","line":383,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 386: os.Setenv(activeHelpEnvVar(rootCmd.Name()), activeHelpCfg)","file":"active_help_test.go","line":386,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 401: ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, activeHelpEnvVar(name)))","file":"bash_completions.go","line":401,"lexical":0.5,"target":false},{"text":"File: bash_completionsV2_test.go\nLine 31: activeHelpVar := activeHelpEnvVar(c.Name())","file":"bash_completionsV2_test.go","line":31,"lexical":0.5,"target":false},{"text":"File: bash_completions_test.go\nLine 287: activeHelpVar := activeHelpEnvVar(c.Name())","file":"bash_completions_test.go","line":287,"lexical":0.5,"target":false},{"text":"File: fish_completions.go\nLine 272: ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))","file":"fish_completions.go","line":272,"lexical":0.5,"target":false},{"text":"File: fish_completions_test.go\nLine 97: activeHelpVar := activeHelpEnvVar(c.Name())","file":"fish_completions_test.go","line":97,"lexical":0.5,"target":false},{"text":"File: powershell_completions.go\nLine 310: ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))","file":"powershell_completions.go","line":310,"lexical":0.5,"target":false},{"text":"File: powershell_completions_test.go\nLine 31: activeHelpVar := activeHelpEnvVar(c.Name())","file":"powershell_completions_test.go","line":31,"lexical":0.5,"target":false},{"text":"File: powershell_completions_test.go\nLine 32: check(t, output, fmt.Sprintf(\"${env:%s}=0\", activeHelpVar))","file":"powershell_completions_test.go","line":32,"lexical":0.5,"target":false},{"text":"File: site/content/active_help.md\nLine 136: **Note 1**: If the `<PROGRAM>_ACTIVE_HELP` environment variable is set to the string \"0\", Cobra will automatically disable all Active Help output (even if some output was specified by the program using the `cobra.AppendActiveHelp(...)` function). Using \"0…","file":"site/content/active_help.md","line":136,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 138: **Note 2**: If a user wants to disable Active Help for every single program based on Cobra, she can set the environment variable `COBRA_ACTIVE_HELP` to \"0\". In this case `cobra.GetActiveHelpConfig(cmd)` will return \"0\" no matter what the variable `<PROGRA…","file":"site/content/active_help.md","line":138,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 153: …with the `__complete` command, if you want to specify different Active Help configurations, you should use the active help environment variable. That variable is named `<PROGRAM>_ACTIVE_HELP` where any non-ASCII-alphanumeric characters are replaced by an …","file":"site/content/active_help.md","line":153,"lexical":0.65,"target":false},{"text":"File: zsh_completions_test.go\nLine 31: activeHelpVar := activeHelpEnvVar(c.Name())","file":"zsh_completions_test.go","line":31,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"當執行指令時,如果輸入的名稱與預期不符,似乎是因為在處理指令集合時使用了基於名稱的排序或查找方式,導致某些子指令無法被正確識別。","query":"command name sort","file":"doc/util.go","symbol":"byName","line":48,"lang":"zh","candidates":[{"text":"File: command.go\nLine 1324: // Sorts commands by their names.","file":"command.go","line":1324,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1325: type commandSorterByName []*Command","file":"command.go","line":1325,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1327: func (c commandSorterByName) Len() int { return len(c) }","file":"command.go","line":1327,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1328: func (c commandSorterByName) Swap(i, j int) { c[i], c[j] = c[j], c[i] }","file":"command.go","line":1328,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1329: func (c commandSorterByName) Less(i, j int) bool { return c[i].Name() < c[j].Name() }","file":"command.go","line":1329,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1335: sort.Sort(commandSorterByName(c.commands))","file":"command.go","line":1335,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"trouve la méthode qui récupère le préfixe des messages d'erreur en remontant la hiérarchie","query":"error prefix","file":"command.go","symbol":"ErrPrefix","line":643,"lang":"fr","candidates":[{"text":"File: cobra.go\nLine 234: // CheckErr prints the msg with the prefix 'Error:' and exits with error code 1. If the msg is nil, it does nothing.","file":"cobra.go","line":234,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 194: // errPrefix is the error message prefix defined by user.","file":"command.go","line":194,"lexical":0.39999999999999997,"target":true},{"text":"File: command.go\nLine 375: // SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix.","file":"command.go","line":375,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 642: // ErrPrefix return error message prefix for the command","file":"command.go","line":642,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 1131: c.PrintErrln(c.ErrPrefix(), err.Error())","file":"command.go","line":1131,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 1160: c.PrintErrln(cmd.ErrPrefix(), err.Error())","file":"command.go","line":1160,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1269: rootCmd.SetErrPrefix(\"root error prefix:\")","file":"command_test.go","line":1269,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1277: checkStringContains(t, output, \"root error prefix: unknown flag: --unknown-flag\")","file":"command_test.go","line":1277,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1284: rootCmd.SetErrPrefix(\"root error prefix:\")","file":"command_test.go","line":1284,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1285: subCmd.SetErrPrefix(\"sub error prefix:\")","file":"command_test.go","line":1285,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1290: checkStringContains(t, output, \"root error prefix: unknown flag: --unknown-root-flag\")","file":"command_test.go","line":1290,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1296: checkStringContains(t, output, \"sub error prefix: unknown flag: --unknown-sub-flag\")","file":"command_test.go","line":1296,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 682: ## Error Message Prefix","file":"site/content/user_guide.md","line":682,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 686: The Prefix, `Error:` can be customized using the `cmd.SetErrPrefix(s string)` function.","file":"site/content/user_guide.md","line":686,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"debug print completion logs with trailing newline","query":"comp debugln","file":"completions.go","symbol":"CompDebugln","line":980,"lang":"en","candidates":[{"text":"File: completions.go\nLine 976: // CompDebugln prints the specified string with a newline at the end","file":"completions.go","line":976,"lexical":0.6000000000000001,"target":true},{"text":"File: completions.go\nLine 980: func CompDebugln(msg string, printToStdErr bool) {","file":"completions.go","line":980,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/completions/_index.md\nLine 264: cobra.CompDebugln(msg string, printToStdErr bool)","file":"site/content/completions/_index.md","line":264,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"获取Windows下从资源管理器启动时的帮助提示文本","query":"windows help text","file":"cobra.go","symbol":"MousetrapHelpText","line":72,"lang":"zh","candidates":[{"text":"File: cobra.go\nLine 68: // MousetrapHelpText enables an information splash screen on Windows","file":"cobra.go","line":68,"lexical":0.44999999999999996,"target":true},{"text":"File: cobra.go\nLine 77: // MousetrapDisplayDuration controls how long the MousetrapHelpText message is displayed on Windows","file":"cobra.go","line":77,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"find the function that provides shell completion logic by comparing command arguments and the partial input string","query":"shell completion helper","file":"completions_test.go","symbol":"_","line":2929,"lang":"en","candidates":[{"text":"File: completions_test.go\nLine 2946: type UserCompletionTypeHelper func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)","file":"completions_test.go","line":2946,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 2964: type UserCompletionTypeAliasHelper = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)","file":"completions_test.go","line":2964,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Estou tentando customizar as mensagens de erro que aparecem no log. Onde eu configuro aquele valor que vai no início de cada mensagem de erro?","query":"error prefix","file":"command.go","symbol":"SetErrPrefix","line":376,"lang":"pt","candidates":[{"text":"File: cobra.go\nLine 234: // CheckErr prints the msg with the prefix 'Error:' and exits with error code 1. If the msg is nil, it does nothing.","file":"cobra.go","line":234,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 194: // errPrefix is the error message prefix defined by user.","file":"command.go","line":194,"lexical":0.39999999999999997,"target":true},{"text":"File: command.go\nLine 375: // SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix.","file":"command.go","line":375,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 642: // ErrPrefix return error message prefix for the command","file":"command.go","line":642,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 1131: c.PrintErrln(c.ErrPrefix(), err.Error())","file":"command.go","line":1131,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 1160: c.PrintErrln(cmd.ErrPrefix(), err.Error())","file":"command.go","line":1160,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1269: rootCmd.SetErrPrefix(\"root error prefix:\")","file":"command_test.go","line":1269,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1277: checkStringContains(t, output, \"root error prefix: unknown flag: --unknown-flag\")","file":"command_test.go","line":1277,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1284: rootCmd.SetErrPrefix(\"root error prefix:\")","file":"command_test.go","line":1284,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1285: subCmd.SetErrPrefix(\"sub error prefix:\")","file":"command_test.go","line":1285,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1290: checkStringContains(t, output, \"root error prefix: unknown flag: --unknown-root-flag\")","file":"command_test.go","line":1290,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1296: checkStringContains(t, output, \"sub error prefix: unknown flag: --unknown-sub-flag\")","file":"command_test.go","line":1296,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 682: ## Error Message Prefix","file":"site/content/user_guide.md","line":682,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 686: The Prefix, `Error:` can be customized using the `cmd.SetErrPrefix(s string)` function.","file":"site/content/user_guide.md","line":686,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Como validar se a função de compleição de argumentos única de um comando raiz está retornando as sugestões corretas para strings vazias e com prefixo?","query":"valid args function test","file":"completions_test.go","symbol":"TestValidArgsFuncSingleCmd","line":1318,"lang":"pt","candidates":[{"text":"File: completions_test.go\nLine 441: // Test that both sub-commands and validArgsFunction are completed","file":"completions_test.go","line":441,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 2290: // Test that if both ValidArgs and ValidArgsFunction are present","file":"completions_test.go","line":2290,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2805: // Test that when DisableFlagParsing==true, ValidArgsFunction is called to complete flag names,","file":"completions_test.go","line":2805,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2827: // Test that when DisableFlagParsing==false, Cobra completes the flags itself and ValidArgsFunction is not called","file":"completions_test.go","line":2827,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Estou tentando entender como o CLI identifica o nome amigável que aparece no help. Onde está definida a chave de anotação usada para mapear o nome de exibição do comando?","query":"cobra command display name","file":"command.go","symbol":"CommandDisplayNameAnnotation","line":35,"lang":"pt","candidates":[{"text":"File: command.go\nLine 35: CommandDisplayNameAnnotation = \"cobra_annotation_command_display_name\"","file":"command.go","line":35,"lexical":0.65,"target":true},{"text":"File: site/content/user_guide.md\nLine 840: `cobra.CommandDisplayNameAnnotation` annotation.","file":"site/content/user_guide.md","line":840,"lexical":0.5,"target":false},{"text":"File: site/content/user_guide.md\nLine 857: cobra.CommandDisplayNameAnnotation: \"kubectl myplugin\",","file":"site/content/user_guide.md","line":857,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"trouve la variable qui gère l'activation du tri des commandes par défaut","query":"command sorting","file":"cobra.go","symbol":"EnableCommandSorting","line":59,"lang":"fr","candidates":[{"text":"File: cobra.go\nLine 47: defaultCommandSorting = true","file":"cobra.go","line":47,"lexical":0.39999999999999997,"target":true},{"text":"File: cobra.go\nLine 57: // EnableCommandSorting controls sorting of the slice of commands, which is turned on by default.","file":"cobra.go","line":57,"lexical":0.39999999999999997,"target":false},{"text":"File: cobra.go\nLine 59: var EnableCommandSorting = defaultCommandSorting","file":"cobra.go","line":59,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 1333: // do not sort commands if it already sorted or sorting was disabled","file":"command.go","line":1333,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1334: if EnableCommandSorting && !c.commandsAreSorted {","file":"command.go","line":1334,"lexical":0.6000000000000001,"target":false},{"text":"File: command_test.go\nLine 1914: EnableCommandSorting = true","file":"command_test.go","line":1914,"lexical":0.6000000000000001,"target":false},{"text":"File: command_test.go\nLine 1932: EnableCommandSorting = defaultCommandSorting","file":"command_test.go","line":1932,"lexical":0.6000000000000001,"target":false},{"text":"File: command_test.go\nLine 1935: func TestEnableCommandSortingIsDisabled(t *testing.T) {","file":"command_test.go","line":1935,"lexical":0.6000000000000001,"target":false},{"text":"File: command_test.go\nLine 1936: EnableCommandSorting = false","file":"command_test.go","line":1936,"lexical":0.6000000000000001,"target":false},{"text":"File: command_test.go\nLine 1953: EnableCommandSorting = defaultCommandSorting","file":"command_test.go","line":1953,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"帮我找一下处理命令行参数中横杠选项并将其过滤掉的测试用例在哪里?","query":"strip flags test","file":"command_test.go","symbol":"TestStripFlags","line":643,"lang":"zh","candidates":[{"text":"File: command_test.go\nLine 643: func TestStripFlags(t *testing.T) {","file":"command_test.go","line":643,"lexical":0.65,"target":true},{"text":"File: command_test.go\nLine 709: got := stripFlags(test.input, c)","file":"command_test.go","line":709,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Il y a un risque de plantage (panic) si une commande tente de lier un groupe d'options obligatoires mais qu'une des options spécifiées est introuvable dans la configuration de la commande.","query":"required flag group","file":"flag_groups.go","symbol":"MarkFlagsRequiredTogether","line":33,"lang":"fr","candidates":[{"text":"File: completions_test.go\nLine 3079: childCmd.MarkFlagsRequiredTogether(\"ingroup1\", \"ingroup2\", \"ingroup3\")","file":"completions_test.go","line":3079,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3157: func TestCompletionForOneRequiredGroupFlags(t *testing.T) {","file":"completions_test.go","line":3157,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3179: childCmd.MarkFlagsOneRequired(\"ingroup1\", \"ingroup2\", \"ingroup3\")","file":"completions_test.go","line":3179,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups.go\nLine 38: panic(fmt.Sprintf(\"Failed to find flag %q and mark it as being required in a flag group\", v))","file":"flag_groups.go","line":38,"lexical":0.65,"target":true},{"text":"File: flag_groups.go\nLine 40: if err := c.Flags().SetAnnotation(v, requiredAsGroupAnnotation, append(f.Annotations[requiredAsGroupAnnotation], strings.Join(flagNames, \" \"))); err != nil {","file":"flag_groups.go","line":40,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 54: panic(fmt.Sprintf(\"Failed to find flag %q and mark it as being in a one-required flag group\", v))","file":"flag_groups.go","line":54,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 79: // ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the","file":"flag_groups.go","line":79,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 94: processFlagForGroupAnnotation(flags, pflag, requiredAsGroupAnnotation, groupStatus)","file":"flag_groups.go","line":94,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 95: processFlagForGroupAnnotation(flags, pflag, oneRequiredAnnotation, oneRequiredGroupStatus)","file":"flag_groups.go","line":95,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 99: if err := validateRequiredFlagGroups(groupStatus); err != nil {","file":"flag_groups.go","line":99,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 102: if err := validateOneRequiredFlagGroups(oneRequiredGroupStatus); err != nil {","file":"flag_groups.go","line":102,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 144: func validateRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":144,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 167: func validateOneRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":167,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 183: return fmt.Errorf(\"at least one of the flags in the group [%v] is required\", flagList)","file":"flag_groups.go","line":183,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 221: // - when a flag in a group is present, other flags in the group will be marked required","file":"flag_groups.go","line":221,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 222: // - when none of the flags in a one-required group are present, all flags in the group will be marked required","file":"flag_groups.go","line":222,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 235: processFlagForGroupAnnotation(flags, pflag, requiredAsGroupAnnotation, groupStatus)","file":"flag_groups.go","line":235,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 236: processFlagForGroupAnnotation(flags, pflag, oneRequiredAnnotation, oneRequiredGroupStatus)","file":"flag_groups.go","line":236,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 245: // One of the flags of the group is set, mark the other ones as required","file":"flag_groups.go","line":245,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 253: // If none of the flags of a one-required group are present, we make all the flags","file":"flag_groups.go","line":253,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 255: for flagList, flagnameAndStatus := range oneRequiredGroupStatus {","file":"flag_groups.go","line":255,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 47: flagGroupsRequired []string","file":"flag_groups_test.go","line":47,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 48: flagGroupsOneRequired []string","file":"flag_groups_test.go","line":48,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 50: subCmdFlagGroupsRequired []string","file":"flag_groups_test.go","line":50,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 51: subCmdFlagGroupsOneRequired []string","file":"flag_groups_test.go","line":51,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 60: flagGroupsRequired: []string{\"a b\"},","file":"flag_groups_test.go","line":60,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 63: desc: \"Required flag group not satisfied\",","file":"flag_groups_test.go","line":63,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 64: flagGroupsRequired: []string{\"a b c\"},","file":"flag_groups_test.go","line":64,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 68: desc: \"One-required flag group not satisfied\",","file":"flag_groups_test.go","line":68,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 69: flagGroupsOneRequired: []string{\"a b\"},","file":"flag_groups_test.go","line":69,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 71: expectErr: \"at least one of the flags in the group [a b] is required\",","file":"flag_groups_test.go","line":71,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 78: desc: \"Multiple required flag group not satisfied returns first error\",","file":"flag_groups_test.go","line":78,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"go 언어에서 명령어 자동 완성 테스트 로직 찾아줘","query":"test command completion","file":"completions_test.go","symbol":"TestCmdNameCompletionInGo","line":55,"lang":"ko","candidates":[{"text":"File: completions_test.go\nLine 1398: // Test completion of first sub-command with empty argument","file":"completions_test.go","line":1398,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 1414: // Test completion of first sub-command with a prefix to complete","file":"completions_test.go","line":1414,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1443: // Test completion of second sub-command with empty argument","file":"completions_test.go","line":1443,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1498: // Test completion of first sub-command with empty argument","file":"completions_test.go","line":1498,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1514: // Test completion of first sub-command with a prefix to complete","file":"completions_test.go","line":1514,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1731: // Test completion of first sub-command with empty argument","file":"completions_test.go","line":1731,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1747: // Test completion of first sub-command with a prefix to complete","file":"completions_test.go","line":1747,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1776: // Test completion of second sub-command with empty argument","file":"completions_test.go","line":1776,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2044: func TestFlagCompletionWorksRootCommandAddedAfterFlags(t *testing.T) {","file":"completions_test.go","line":2044,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2399: // Test that completion includes the help command","file":"completions_test.go","line":2399,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2452: // Remove completion command for the next test","file":"completions_test.go","line":2452,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2468: // Test that when there are no sub-commands, the completion command is not created if it is not called directly.","file":"completions_test.go","line":2468,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2477: // Test that when there are no sub-commands, the completion command is created when it is called directly.","file":"completions_test.go","line":2477,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2484: // Remove completion command for the next test","file":"completions_test.go","line":2484,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2494: // Test that a completion command is created if there are other sub-commands","file":"completions_test.go","line":2494,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2506: // Remove completion command for the next test","file":"completions_test.go","line":2506,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2509: // Test that the default completion command can be disabled","file":"completions_test.go","line":2509,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2529: // Remove completion command for the next test","file":"completions_test.go","line":2529,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2542: // Remove completion command for the next test","file":"completions_test.go","line":2542,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2556: // Remove completion command for the next test","file":"completions_test.go","line":2556,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2572: // Remove completion command for the next test","file":"completions_test.go","line":2572,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2588: // Remove completion command for the next test","file":"completions_test.go","line":2588,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2591: // Test that the 'completion' command can be hidden","file":"completions_test.go","line":2591,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2603: // Remove completion command for the next test","file":"completions_test.go","line":2603,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2610: // Test that when there are no sub-commands, the 'completion' command is not completed","file":"completions_test.go","line":2610,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2625: // Test that when there are no sub-commands, completion can be triggered for the default","file":"completions_test.go","line":2625,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2651: // Test sub-commands of the completion command","file":"completions_test.go","line":2651,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2669: // Test there are no completions for the sub-commands of the completion command","file":"completions_test.go","line":2669,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"schreibe eine methode die den fehlerausgabestrom zurückgibt","query":"stderr writer","file":"command.go","symbol":"ErrOrStderr","line":403,"lang":"de","candidates":[{"text":"File: command.go\nLine 201: // errWriter is a writer defined by the user that replaces stderr","file":"command.go","line":201,"lexical":0.39999999999999997,"target":true},{"text":"File: command.go\nLine 398: func (c *Command) OutOrStderr() io.Writer {","file":"command.go","line":398,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 403: func (c *Command) ErrOrStderr() io.Writer {","file":"command.go","line":403,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"where is the variable that holds the file extension string used for shell completion?","query":"file extension completion","file":"bash_completions.go","symbol":"ext","line":484,"lang":"en","candidates":[{"text":"File: bash_completions.go\nLine 30: BashCompFilenameExt = \"cobra_annotation_bash_completion_filename_extensions\"","file":"bash_completions.go","line":30,"lexical":0.65,"target":true},{"text":"File: bash_completions_test.go\nLine 195: check(t, output, fmt.Sprintf(`flags_completion+=(\"__%s_handle_filename_extension_flag json|yaml|yml\")`, rootCmd.Name()))","file":"bash_completions_test.go","line":195,"lexical":0.65,"target":false},{"text":"File: bash_completions_test.go\nLine 197: checkRegex(t, output, fmt.Sprintf(`_root_echo\\(\\)\\n{[^}]*flags_completion\\+=\\(\"__%s_handle_filename_extension_flag json\\|yaml\\|yml\"\\)`, rootCmd.Name()))","file":"bash_completions_test.go","line":197,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 409: // File completion filtered by extensions","file":"completions.go","line":409,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 43: // limit completions for the named flag to the specified file extensions.","file":"shell_completions.go","line":43,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 66: // limit completions for the named flag to the specified file extensions.","file":"shell_completions.go","line":66,"lexical":0.65,"target":false},{"text":"File: site/content/completions/_index.md\nLine 213: // Indicates that the returned completions should be used as file extension filters.","file":"site/content/completions/_index.md","line":213,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 353: To limit completions of flag values to file names with certain extensions you can either use the different `MarkFlagFilename()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterFileExt`, like so:","file":"site/content/completions/_index.md","line":353,"lexical":0.55,"target":false},{"text":"File: site/content/completions/zsh.md\nLine 27: |`cmd.MarkZshCompPositionalArgumentFile(pos, glob[])` used to turn on file completion **with glob filtering** on a per-argument position basis (zsh-specific)|`cmd.MarkZshCompPositionalArgumentFile()` is **deprecated** and silently ignored; use `ValidArgsFu…","file":"site/content/completions/zsh.md","line":27,"lexical":0.55,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Finde die Testfunktion, die prüft, ob bei falscher Argumentanzahl die korrekte Fehlermeldung „accepts 2 arg(s), received 3“ zurückgegeben wird.","query":"test invalid arg count error","file":"args_test.go","symbol":"exactArgsWithInvalidCount","line":88,"lang":"de","candidates":[{"text":"File: args_test.go\nLine 88: func exactArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":88,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"帮我找一下那个只会一直返回 hello 的最烂自定义测试函数在哪里","query":"COMPREPLY hello","file":"bash_completions_test.go","symbol":"bashCompletionFunc","line":78,"lang":"zh","candidates":[{"text":"File: bash_completions_test.go\nLine 79: COMPREPLY=( \"hello\" )","file":"bash_completions_test.go","line":79,"lexical":0.39999999999999997,"target":true},{"text":"File: bash_completions_test.go\nLine 183: check(t, output, `COMPREPLY=( \"hello\" )`)","file":"bash_completions_test.go","line":183,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"find tests checking error handling when passing fewer than required arguments to a command","query":"minimum args test","file":"args_test.go","symbol":"TestMinimumNArgs_WithLessArgs_WithValid","line":251,"lang":"en","candidates":[{"text":"File: args_test.go\nLine 66: func minimumNArgsWithLessArgs(err error, t *testing.T) {","file":"args_test.go","line":66,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 221: func TestMinimumNArgs(t *testing.T) {","file":"args_test.go","line":221,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 227: func TestMinimumNArgs_WithValid(t *testing.T) {","file":"args_test.go","line":227,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 233: func TestMinimumNArgs_WithValid__WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":233,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 239: func TestMinimumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":239,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 245: func TestMinimumNArgs_WithLessArgs(t *testing.T) {","file":"args_test.go","line":245,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 251: func TestMinimumNArgs_WithLessArgs_WithValid(t *testing.T) {","file":"args_test.go","line":251,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 257: func TestMinimumNArgs_WithLessArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":257,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 263: func TestMinimumNArgs_WithLessArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":263,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Se ha detectado que no hay una forma clara de inyectar una función personalizada para manejar la ayuda cuando se ejecuta un comando. Necesito localizar dónde se puede configurar la lógica que define cómo se muestra la información de ayuda para los comandos ejecutados por la aplicación.","query":"set help function","file":"command.go","symbol":"SetHelpFunc","line":333,"lang":"es","candidates":[{"text":"File: command.go\nLine 332: // SetHelpFunc sets help function. Can be defined by Application.","file":"command.go","line":332,"lexical":0.44999999999999996,"target":true},{"text":"File: command.go\nLine 482: // HelpFunc returns either the function set by SetHelpFunc for this command","file":"command.go","line":482,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/active_help.md\nLine 136: **Note 1**: If the `<PROGRAM>_ACTIVE_HELP` environment variable is set to the string \"0\", Cobra will automatically disable all Active Help output (even if some output was specified by the program using the `cobra.AppendActiveHelp(...)` function). Using \"0…","file":"site/content/active_help.md","line":136,"lexical":0.65,"target":false},{"text":"File: site/content/completions/bash.md\nLine 64: The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__kubectl_custom_func()` (`__<command-use>_custom_func()`) to be called when the built in processor was unable to find a solution. In the case …","file":"site/content/completions/bash.md","line":64,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"获取指定程序名称的ActiveHelp环境变量名","query":"active help env var","file":"active_help.go","symbol":"activeHelpEnvVar","line":58,"lang":"zh","candidates":[{"text":"File: active_help.go\nLine 26: activeHelpEnvVarSuffix = \"ACTIVE_HELP\"","file":"active_help.go","line":26,"lexical":0.65,"target":true},{"text":"File: active_help.go\nLine 27: activeHelpGlobalEnvVar = configEnvVarGlobalPrefix + \"_\" + activeHelpEnvVarSuffix","file":"active_help.go","line":27,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 42: // GetActiveHelpConfig returns the value of the ActiveHelp environment variable","file":"active_help.go","line":42,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 45: // It will always return \"0\" if the global environment variable COBRA_ACTIVE_HELP","file":"active_help.go","line":45,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 48: activeHelpCfg := os.Getenv(activeHelpGlobalEnvVar)","file":"active_help.go","line":48,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 50: activeHelpCfg = os.Getenv(activeHelpEnvVar(cmd.Root().Name()))","file":"active_help.go","line":50,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 55: // activeHelpEnvVar returns the name of the program-specific ActiveHelp environment","file":"active_help.go","line":55,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 58: func activeHelpEnvVar(name string) string {","file":"active_help.go","line":58,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 59: return configEnvVar(name, activeHelpEnvVarSuffix)","file":"active_help.go","line":59,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 281: os.Setenv(activeHelpEnvVar(rootCmd.Name()), activeHelpCfg)","file":"active_help_test.go","line":281,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 299: os.Setenv(activeHelpEnvVar(rootCmd.Name()), activeHelpCfg)","file":"active_help_test.go","line":299,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 336: os.Setenv(activeHelpEnvVar(rootCmd.Name()), \"0\")","file":"active_help_test.go","line":336,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 348: os.Unsetenv(activeHelpEnvVar(rootCmd.Name()))","file":"active_help_test.go","line":348,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 361: os.Setenv(activeHelpGlobalEnvVar, \"0\")","file":"active_help_test.go","line":361,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 364: os.Setenv(activeHelpEnvVar(rootCmd.Name()), \"1\")","file":"active_help_test.go","line":364,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 383: os.Setenv(activeHelpGlobalEnvVar, \"on\")","file":"active_help_test.go","line":383,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 386: os.Setenv(activeHelpEnvVar(rootCmd.Name()), activeHelpCfg)","file":"active_help_test.go","line":386,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 401: ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, activeHelpEnvVar(name)))","file":"bash_completions.go","line":401,"lexical":0.5,"target":false},{"text":"File: bash_completionsV2_test.go\nLine 31: activeHelpVar := activeHelpEnvVar(c.Name())","file":"bash_completionsV2_test.go","line":31,"lexical":0.5,"target":false},{"text":"File: bash_completions_test.go\nLine 287: activeHelpVar := activeHelpEnvVar(c.Name())","file":"bash_completions_test.go","line":287,"lexical":0.5,"target":false},{"text":"File: fish_completions.go\nLine 272: ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))","file":"fish_completions.go","line":272,"lexical":0.5,"target":false},{"text":"File: fish_completions_test.go\nLine 97: activeHelpVar := activeHelpEnvVar(c.Name())","file":"fish_completions_test.go","line":97,"lexical":0.5,"target":false},{"text":"File: powershell_completions.go\nLine 310: ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))","file":"powershell_completions.go","line":310,"lexical":0.5,"target":false},{"text":"File: powershell_completions_test.go\nLine 31: activeHelpVar := activeHelpEnvVar(c.Name())","file":"powershell_completions_test.go","line":31,"lexical":0.5,"target":false},{"text":"File: powershell_completions_test.go\nLine 32: check(t, output, fmt.Sprintf(\"${env:%s}=0\", activeHelpVar))","file":"powershell_completions_test.go","line":32,"lexical":0.5,"target":false},{"text":"File: site/content/active_help.md\nLine 136: **Note 1**: If the `<PROGRAM>_ACTIVE_HELP` environment variable is set to the string \"0\", Cobra will automatically disable all Active Help output (even if some output was specified by the program using the `cobra.AppendActiveHelp(...)` function). Using \"0…","file":"site/content/active_help.md","line":136,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 138: **Note 2**: If a user wants to disable Active Help for every single program based on Cobra, she can set the environment variable `COBRA_ACTIVE_HELP` to \"0\". In this case `cobra.GetActiveHelpConfig(cmd)` will return \"0\" no matter what the variable `<PROGRA…","file":"site/content/active_help.md","line":138,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 153: …with the `__complete` command, if you want to specify different Active Help configurations, you should use the active help environment variable. That variable is named `<PROGRAM>_ACTIVE_HELP` where any non-ASCII-alphanumeric characters are replaced by an …","file":"site/content/active_help.md","line":153,"lexical":0.65,"target":false},{"text":"File: zsh_completions_test.go\nLine 31: activeHelpVar := activeHelpEnvVar(c.Name())","file":"zsh_completions_test.go","line":31,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"'name' 플래그에 대한 셸 자동 완성을 특정 파일 확장자로 제한하려면 어떻게 작성하나요?","query":"shell completion flag filename","file":"shell_completions.go","symbol":"MarkFlagFilename","line":44,"lang":"ko","candidates":[{"text":"File: completions_test.go\nLine 1640: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"filename\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":1640,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2203: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"filename\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2203,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 42: // MarkFlagFilename instructs the various shell completion implementations to","file":"shell_completions.go","line":42,"lexical":0.65,"target":true},{"text":"File: shell_completions.go\nLine 58: // MarkPersistentFlagFilename instructs the various shell completion","file":"shell_completions.go","line":58,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 65: // MarkFlagFilename instructs the various shell completion implementations to","file":"shell_completions.go","line":65,"lexical":0.65,"target":false},{"text":"File: site/content/completions/_index.md\nLine 353: To limit completions of flag values to file names with certain extensions you can either use the different `MarkFlagFilename()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterFileExt`, like so:","file":"site/content/completions/_index.md","line":353,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/completions/zsh.md\nLine 36: |`cmd.MarkFlagFilename(flag, glob[])` used to turn on file completion **with glob filtering** (syntax of `[]string{\"*.yaml\", \"*.yml\"}` incompatible with bash)|Will continue to work, however, support for bash syntax is added and should be used instead so a…","file":"site/content/completions/zsh.md","line":36,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"コマンドラインオプションの処理結果として、解析されたオプション情報(コマンド名、短いフラグ、長いフラグ、ヘルプメッセージ、デフォルト値、型、必須フラグなど)を保持する変数を確認してください。","query":"cmdOption result","file":"doc/yaml_docs.go","symbol":"result","line":150,"lang":"ja","candidates":[{"text":"File: doc/yaml_docs.go\nLine 149: func genFlagResult(flags *pflag.FlagSet) []cmdOption {","file":"doc/yaml_docs.go","line":149,"lexical":0.39999999999999997,"target":true},{"text":"File: doc/yaml_docs.go\nLine 150: var result []cmdOption","file":"doc/yaml_docs.go","line":150,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"busca o método que recupera o escritor de erros seguindo a hierarquia de comandos","query":"get error writer","file":"command.go","symbol":"getErr","line":422,"lang":"pt","candidates":[{"text":"File: command.go\nLine 464: func (c *Command) getUsageTemplateFunc() func(w io.Writer, data interface{}) error {","file":"command.go","line":464,"lexical":0.44999999999999996,"target":true},{"text":"File: command.go\nLine 505: func (c *Command) getHelpTemplateFunc() func(w io.Writer, data interface{}) error {","file":"command.go","line":505,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 631: func (c *Command) getVersionTemplateFunc() func(w io.Writer, data interface{}) error {","file":"command.go","line":631,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Where is the logic that triggers the help text output when a user enters an incorrect argument?","query":"usage error output","file":"command.go","symbol":"Usage","line":478,"lang":"en","candidates":[{"text":"File: command.go\nLine 285: // SetOutput sets the destination for usage and error messages.","file":"command.go","line":285,"lexical":0.44999999999999996,"target":true},{"text":"File: command_test.go\nLine 270: t.Errorf(\"Expected blank output, because of silenced usage.\\nGot:\\n %q\\n\", output)","file":"command_test.go","line":270,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1398: t.Error(\"Usage output is not printed exactly once\")","file":"command_test.go","line":1398,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"플래그 파싱 실패 시 에러를 생성하는 함수 설정하는 메서드 찾아줘","query":"flag error func","file":"command.go","symbol":"SetFlagErrorFunc","line":328,"lang":"ko","candidates":[{"text":"File: command.go\nLine 175: // flagErrorFunc is func defined by user and it's called when the parsing of","file":"command.go","line":175,"lexical":0.44999999999999996,"target":true},{"text":"File: command.go\nLine 177: flagErrorFunc func(*Command, error) error","file":"command.go","line":177,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 326: // SetFlagErrorFunc sets a function to generate an error when flag parsing","file":"command.go","line":326,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 328: func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) {","file":"command.go","line":328,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 329: c.flagErrorFunc = f","file":"command.go","line":329,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 544: // FlagErrorFunc returns either the function set by SetFlagErrorFunc for this","file":"command.go","line":544,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 547: func (c *Command) FlagErrorFunc() (f func(*Command, error) error) {","file":"command.go","line":547,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 548: if c.flagErrorFunc != nil {","file":"command.go","line":548,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 549: return c.flagErrorFunc","file":"command.go","line":549,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 553: return c.parent.FlagErrorFunc()","file":"command.go","line":553,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 921: return c.FlagErrorFunc()(c, err)","file":"command.go","line":921,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 1180: func (c *Command) ValidateRequiredFlags() error {","file":"command.go","line":1180,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 1868: func (c *Command) ParseFlags(args []string) error {","file":"command.go","line":1868,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1818: t.Error(\"Normalization function should be passed on to Local flag set\")","file":"command_test.go","line":1818,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1841: t.Error(\"Normalization function should be passed on to inherited flag set in command added before flag\")","file":"command_test.go","line":1841,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1846: t.Error(\"Normalization function should be passed on to inherited flag set in command added after flag\")","file":"command_test.go","line":1846,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2218: func TestFlagErrorFunc(t *testing.T) {","file":"command_test.go","line":2218,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2222: c.SetFlagErrorFunc(func(_ *Command, err error) error {","file":"command_test.go","line":2222,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2235: func TestFlagErrorFuncHelp(t *testing.T) {","file":"command_test.go","line":2235,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2238: c.SetFlagErrorFunc(func(_ *Command, err error) error {","file":"command_test.go","line":2238,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2882: func TestUnknownFlagShouldReturnSameErrorRegardlessOfArgPosition(t *testing.T) {","file":"command_test.go","line":2882,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 52: func (e *flagCompError) Error() string {","file":"completions.go","line":52,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 170: func (c *Command) RegisterFlagCompletionFunc(flagName string, f CompletionFunc) error {","file":"completions.go","line":170,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 173: return fmt.Errorf(\"RegisterFlagCompletionFunc: flag '%s' does not exist\", flagName)","file":"completions.go","line":173,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 179: return fmt.Errorf(\"RegisterFlagCompletionFunc: flag '%s' already registered\", flagName)","file":"completions.go","line":179,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 657: func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg string) (*pflag.Flag, []string, string, error) {","file":"completions.go","line":657,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3721: t.Errorf(\"Unexpected result looking for flag completion function\")","file":"completions_test.go","line":3721,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups.go\nLine 81: func (c *Command) ValidateFlagGroups() error {","file":"flag_groups.go","line":81,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 144: func validateRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":144,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 167: func validateOneRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":167,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 188: func validateExclusiveFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":188,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 24: func (c *Command) MarkFlagRequired(name string) error {","file":"shell_completions.go","line":24,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"補完機能のテストコードを書いていますが、サブコマンドがない場合に特定のコマンドが正しく候補として出ないことを検証している部分を探したいです。このテストケースがどのように動作をチェックしているか教えてください。","query":"test completion command","file":"completions_test.go","symbol":"TestCompleteCompletion","line":2607,"lang":"ja","candidates":[{"text":"File: completions_test.go\nLine 1398: // Test completion of first sub-command with empty argument","file":"completions_test.go","line":1398,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 1414: // Test completion of first sub-command with a prefix to complete","file":"completions_test.go","line":1414,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1443: // Test completion of second sub-command with empty argument","file":"completions_test.go","line":1443,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1498: // Test completion of first sub-command with empty argument","file":"completions_test.go","line":1498,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1514: // Test completion of first sub-command with a prefix to complete","file":"completions_test.go","line":1514,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1731: // Test completion of first sub-command with empty argument","file":"completions_test.go","line":1731,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1747: // Test completion of first sub-command with a prefix to complete","file":"completions_test.go","line":1747,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1776: // Test completion of second sub-command with empty argument","file":"completions_test.go","line":1776,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2044: func TestFlagCompletionWorksRootCommandAddedAfterFlags(t *testing.T) {","file":"completions_test.go","line":2044,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2399: // Test that completion includes the help command","file":"completions_test.go","line":2399,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2452: // Remove completion command for the next test","file":"completions_test.go","line":2452,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2468: // Test that when there are no sub-commands, the completion command is not created if it is not called directly.","file":"completions_test.go","line":2468,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2477: // Test that when there are no sub-commands, the completion command is created when it is called directly.","file":"completions_test.go","line":2477,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2484: // Remove completion command for the next test","file":"completions_test.go","line":2484,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2494: // Test that a completion command is created if there are other sub-commands","file":"completions_test.go","line":2494,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2506: // Remove completion command for the next test","file":"completions_test.go","line":2506,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2509: // Test that the default completion command can be disabled","file":"completions_test.go","line":2509,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2529: // Remove completion command for the next test","file":"completions_test.go","line":2529,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2542: // Remove completion command for the next test","file":"completions_test.go","line":2542,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2556: // Remove completion command for the next test","file":"completions_test.go","line":2556,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2572: // Remove completion command for the next test","file":"completions_test.go","line":2572,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2588: // Remove completion command for the next test","file":"completions_test.go","line":2588,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2591: // Test that the 'completion' command can be hidden","file":"completions_test.go","line":2591,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2603: // Remove completion command for the next test","file":"completions_test.go","line":2603,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2610: // Test that when there are no sub-commands, the 'completion' command is not completed","file":"completions_test.go","line":2610,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2625: // Test that when there are no sub-commands, completion can be triggered for the default","file":"completions_test.go","line":2625,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2651: // Test sub-commands of the completion command","file":"completions_test.go","line":2651,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2669: // Test there are no completions for the sub-commands of the completion command","file":"completions_test.go","line":2669,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"There is an issue where adding a new value to a space-separated list fails if the value is already a substring of another element in that list, even if it isn't a standalone entry.","query":"append if not present","file":"cobra.go","symbol":"appendIfNotPresent","line":166,"lang":"en","candidates":[{"text":"File: cobra.go\nLine 36: \"appendIfNotPresent\": appendIfNotPresent,","file":"cobra.go","line":36,"lexical":0.5,"target":true},{"text":"File: cobra.go\nLine 163: // FIXME appendIfNotPresent is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra.","file":"cobra.go","line":163,"lexical":0.5,"target":false},{"text":"File: cobra.go\nLine 165: // appendIfNotPresent will append stringToAppend to the end of s, but only if it's not yet present in s.","file":"cobra.go","line":165,"lexical":0.5,"target":false},{"text":"File: cobra.go\nLine 166: func appendIfNotPresent(s, stringToAppend string) string {","file":"cobra.go","line":166,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"I'm trying to clean up the command tree before running some automated tests. Where is the logic that strips out the autocomplete subcommands from the main command structure?","query":"remove command test","file":"completions_test.go","symbol":"removeCompCmd","line":2451,"lang":"en","candidates":[{"text":"File: command_test.go\nLine 1585: func TestRemoveCommand(t *testing.T) {","file":"command_test.go","line":1585,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1597: func TestReplaceCommandWithRemove(t *testing.T) {","file":"command_test.go","line":1597,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2452: // Remove completion command for the next test","file":"completions_test.go","line":2452,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 2484: // Remove completion command for the next test","file":"completions_test.go","line":2484,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2506: // Remove completion command for the next test","file":"completions_test.go","line":2506,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2529: // Remove completion command for the next test","file":"completions_test.go","line":2529,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2542: // Remove completion command for the next test","file":"completions_test.go","line":2542,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2556: // Remove completion command for the next test","file":"completions_test.go","line":2556,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2572: // Remove completion command for the next test","file":"completions_test.go","line":2572,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2588: // Remove completion command for the next test","file":"completions_test.go","line":2588,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2603: // Remove completion command for the next test","file":"completions_test.go","line":2603,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Ich arbeite gerade an den CLI-Tests. Kannst du mir zeigen, wie die Generierung der Autovervollständigungs-Dateien für die Shell überprüft wird?","query":"fish completion test","file":"fish_completions_test.go","symbol":"TestGenFishCompletionFile","line":101,"lang":"de","candidates":[{"text":"File: fish_completions.go\nLine 35: WriteStringAndCheck(buf, fmt.Sprintf(\"# fish completion for %-36s -*- shell-script -*-\\n\", name))","file":"fish_completions.go","line":35,"lexical":0.65,"target":false},{"text":"File: fish_completions_test.go\nLine 89: func TestFishCompletionNoActiveHelp(t *testing.T) {","file":"fish_completions_test.go","line":89,"lexical":0.65,"target":true},{"text":"File: fish_completions_test.go\nLine 101: func TestGenFishCompletionFile(t *testing.T) {","file":"fish_completions_test.go","line":101,"lexical":0.65,"target":false},{"text":"File: fish_completions_test.go\nLine 120: func TestFailGenFishCompletionFile(t *testing.T) {","file":"fish_completions_test.go","line":120,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"コマンド実行時に必須となる永続フラグを設定し、シェル補完時にもそれが優先されるようにする機能について、実装場所を確認したい。また、指定したフラグが欠落している場合にエラーを返す挙動が正しく組み込まれているか調査してほしい。","query":"persistent flag required","file":"shell_completions.go","symbol":"MarkPersistentFlagRequired","line":31,"lang":"ja","candidates":[{"text":"File: bash_completions_test.go\nLine 101: assertNoErr(t, rootCmd.MarkPersistentFlagRequired(\"persistent-filename\"))","file":"bash_completions_test.go","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 871: func TestPersistentRequiredFlags(t *testing.T) {","file":"command_test.go","line":871,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 874: assertNoErr(t, parent.MarkPersistentFlagRequired(\"foo1\"))","file":"command_test.go","line":874,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 876: assertNoErr(t, parent.MarkPersistentFlagRequired(\"foo2\"))","file":"command_test.go","line":876,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 896: func TestPersistentRequiredFlagsWithDisableFlagParsing(t *testing.T) {","file":"command_test.go","line":896,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 897: // Make sure a required persistent flag does not break","file":"command_test.go","line":897,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 903: assertNoErr(t, parent.MarkPersistentFlagRequired(\"foo\"))","file":"command_test.go","line":903,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 863: rootCmd.PersistentFlags().IntP(\"requiredPersistent\", \"p\", -1, \"required persistent\")","file":"completions_test.go","line":863,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 864: assertNoErr(t, rootCmd.MarkPersistentFlagRequired(\"requiredPersistent\"))","file":"completions_test.go","line":864,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 865: requiredPersistent := rootCmd.PersistentFlags().Lookup(\"requiredPersistent\")","file":"completions_test.go","line":865,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 997: // Test that when a persistent required flag is present, it is not suggested anymore","file":"completions_test.go","line":997,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 1020: output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"--requiredFlag\", \"1\", \"--requiredPersistent\", \"1\", \"\")","file":"completions_test.go","line":1020,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups_test.go\nLine 108: desc: \"Persistent flags utilize required and exclusive groups and can fail required groups\",","file":"flag_groups_test.go","line":108,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 114: desc: \"Persistent flags utilize one-required and exclusive groups and can fail one-required groups\",","file":"flag_groups_test.go","line":114,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 120: desc: \"Persistent flags utilize required and exclusive groups and can fail mutually exclusive groups\",","file":"flag_groups_test.go","line":120,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 126: desc: \"Persistent flags utilize required and exclusive groups and can pass\",","file":"flag_groups_test.go","line":126,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 131: desc: \"Persistent flags utilize one-required and exclusive groups and can pass\",","file":"flag_groups_test.go","line":131,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 28: // MarkPersistentFlagRequired instructs the various shell completion implementations to","file":"shell_completions.go","line":28,"lexical":0.44999999999999996,"target":true},{"text":"File: shell_completions.go\nLine 31: func (c *Command) MarkPersistentFlagRequired(name string) error {","file":"shell_completions.go","line":31,"lexical":0.44999999999999996,"target":false},{"text":"File: shell_completions.go\nLine 32: return MarkFlagRequired(c.PersistentFlags(), name)","file":"shell_completions.go","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 329: rootCmd.PersistentFlags().StringVarP(&Region, \"region\", \"r\", \"\", \"AWS region (required)\")","file":"site/content/user_guide.md","line":329,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 330: rootCmd.MarkPersistentFlagRequired(\"region\")","file":"site/content/user_guide.md","line":330,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Quiero verificar que el comando secundario 'child1' reciba correctamente los argumentos 'one' y 'two' y no devuelva salida ni errores al ejecutarse.","query":"child command args","file":"command_test.go","symbol":"TestChildCommand","line":113,"lang":"es","candidates":[{"text":"File: active_help_test.go\nLine 98: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":98,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 121: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 145: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":145,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 183: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":183,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 205: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":205,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 283: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":283,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 305: _ = childCmd.RegisterFlagCompletionFunc(flagname, func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":305,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 338: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":338,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 388: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":388,"lexical":0.44999999999999996,"target":false},{"text":"File: args_test.go\nLine 451: childCmd := &Command{Use: \"child\", Args: NoArgs, Run: emptyRun}","file":"args_test.go","line":451,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 454: _, err := executeCommand(rootCmd, \"child\", \"illegal\", \"args\")","file":"args_test.go","line":454,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 468: childCmd := &Command{Use: \"child\", Args: ArbitraryArgs, Run: emptyRun}","file":"args_test.go","line":468,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 471: _, err := executeCommand(rootCmd, \"child\", \"legal\", \"args\")","file":"args_test.go","line":471,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 569: childCmd := &Command{Use: \"child\", Args: nil, Run: emptyRun}","file":"args_test.go","line":569,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 570: grandchildCmd := &Command{Use: \"grandchild\", Args: nil, Run: emptyRun}","file":"args_test.go","line":570,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 119: Run: func(_ *Command, args []string) { child1CmdArgs = args },","file":"command_test.go","line":119,"lexical":0.65,"target":true},{"text":"File: command_test.go\nLine 121: child2Cmd := &Command{Use: \"child2\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":121,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 824: Run: func(_ *Command, args []string) { childCmdArgs = args },","file":"command_test.go","line":824,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2933: child.SetHelpFunc(func(cmd *Command, args []string) {","file":"command_test.go","line":2933,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1838: _ = childCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":1838,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 2007: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2007,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 2025: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2025,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 2055: _ = childCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2055,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3663: _ = childCmd.RegisterFlagCompletionFunc(\"childflag\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3663,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3842: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3842,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3969: desc: \"no child command not passing args\",","file":"completions_test.go","line":3969,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3975: desc: \"with child command not passing args\",","file":"completions_test.go","line":3975,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"쉘 완성 스크립트가 자동 완성을 요청하기 위해 사용하는 내부 명령어가 무엇인지 확인해주세요.","query":"shell completion command","file":"completions.go","symbol":"ShellCompRequestCmd","line":31,"lang":"ko","candidates":[{"text":"File: active_help_test.go\nLine 240: _ = rootCmd.RegisterFlagCompletionFunc(flagname, func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":240,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 305: _ = childCmd.RegisterFlagCompletionFunc(flagname, func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":305,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 1109: // initialize the __complete command to be used for shell completion","file":"command.go","line":1109,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1274: ValidArgsFunction: func(c *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) {","file":"command.go","line":1274,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 139: type CompletionFunc = func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective)","file":"completions.go","line":139,"lexical":0.65,"target":true},{"text":"File: completions.go\nLine 151: func NoFileCompletions(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) {","file":"completions.go","line":151,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 161: return func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) {","file":"completions.go","line":161,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 239: Short: \"Request shell completion choices for the specified command-line\",","file":"completions.go","line":239,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 240: Long: fmt.Sprintf(\"%[2]s is a special command that is used by the shell completion logic\\n%[1]s\",","file":"completions.go","line":240,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 241: \"to request completion choices for the specified command-line.\", ShellCompRequestCmd),","file":"completions.go","line":241,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 316: func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCompDirective, error) {","file":"completions.go","line":316,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 347: return c, []Completion{}, ShellCompDirectiveDefault, fmt.Errorf(\"unable to find a command for arguments: %v\", trimmedArgs)","file":"completions.go","line":347,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 929: completionCmd.AddCommand(bash, zsh, fish, powershell)","file":"completions.go","line":929,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1630: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"introot\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":1630,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1640: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"filename\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":1640,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1838: _ = childCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":1838,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2055: _ = childCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2055,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2082: _ = rootCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2082,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2152: _ = cmd.RegisterFlagCompletionFunc(flagName, func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2152,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2193: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"introot\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2193,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2203: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"filename\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2203,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2612: output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"completion\")","file":"completions_test.go","line":2612,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2627: output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"completion\", \"\")","file":"completions_test.go","line":2627,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2652: output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"completion\", \"\")","file":"completions_test.go","line":2652,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2704: _ = rootCmd.RegisterFlagCompletionFunc(\"short3\", func(*Command, []string, string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2704,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2913: var userComp func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective)","file":"completions_test.go","line":2913,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2930: var _ func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) = userComp //nolint:staticcheck // LHS type is needed for this use case","file":"completions_test.go","line":2930,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2946: type UserCompletionTypeHelper func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)","file":"completions_test.go","line":2946,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2964: type UserCompletionTypeAliasHelper = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)","file":"completions_test.go","line":2964,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3651: _ = rootCmd.RegisterFlagCompletionFunc(\"rootflag\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3651,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3656: _ = rootCmd.RegisterFlagCompletionFunc(\"persistentflag\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3656,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3663: _ = childCmd.RegisterFlagCompletionFunc(\"childflag\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3663,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"コマンドライン引数に対するシェルの補完候補をリクエストするための隠しサブコマンドを初期化する処理を探しています。","query":"shell completion request","file":"completions.go","symbol":"initCompleteCmd","line":231,"lang":"ja","candidates":[{"text":"File: completions.go\nLine 239: Short: \"Request shell completion choices for the specified command-line\",","file":"completions.go","line":239,"lexical":0.65,"target":true},{"text":"File: completions.go\nLine 241: \"to request completion choices for the specified command-line.\", ShellCompRequestCmd),","file":"completions.go","line":241,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2612: output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"completion\")","file":"completions_test.go","line":2612,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2627: output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"completion\", \"\")","file":"completions_test.go","line":2627,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2652: output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"completion\", \"\")","file":"completions_test.go","line":2652,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"파일 확장자 필터링을 위한 셸_completion_지시어는 무엇인가요?","query":"shell completion filter extension","file":"completions.go","symbol":"ShellCompDirectiveFilterFileExt","line":73,"lang":"ko","candidates":[{"text":"File: site/content/completions/_index.md\nLine 353: To limit completions of flag values to file names with certain extensions you can either use the different `MarkFlagFilename()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterFileExt`, like so:","file":"site/content/completions/_index.md","line":353,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/completions/zsh.md\nLine 27: …shCompPositionalArgumentFile(pos, glob[])` used to turn on file completion **with glob filtering** on a per-argument position basis (zsh-specific)|`cmd.MarkZshCompPositionalArgumentFile()` is **deprecated** and silently ignored; use `ValidArgsFunction` wit…","file":"site/content/completions/zsh.md","line":27,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"帮我找一下测试最小参数数量的单元测试","query":"minimum args test","file":"args_test.go","symbol":"TestMinimumNArgs","line":221,"lang":"zh","candidates":[{"text":"File: args_test.go\nLine 66: func minimumNArgsWithLessArgs(err error, t *testing.T) {","file":"args_test.go","line":66,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 221: func TestMinimumNArgs(t *testing.T) {","file":"args_test.go","line":221,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 227: func TestMinimumNArgs_WithValid(t *testing.T) {","file":"args_test.go","line":227,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 233: func TestMinimumNArgs_WithValid__WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":233,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 239: func TestMinimumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":239,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 245: func TestMinimumNArgs_WithLessArgs(t *testing.T) {","file":"args_test.go","line":245,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 251: func TestMinimumNArgs_WithLessArgs_WithValid(t *testing.T) {","file":"args_test.go","line":251,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 257: func TestMinimumNArgs_WithLessArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":257,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 263: func TestMinimumNArgs_WithLessArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":263,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"인자 개수 제한 설정이 되어 있을 때, 유효한 인자와 유효하지 않은 인자가 섞여서 들어오면 에러 처리가 어떻게 되는지 확인해 주세요.","query":"maximum n args","file":"args_test.go","symbol":"TestMaximumNArgs_WithMoreArgs_WithValidOnly_WithInvalidArgs","line":313,"lang":"ko","candidates":[{"text":"File: args.go\nLine 96: // MaximumNArgs returns an error if there are more than N args.","file":"args.go","line":96,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 97: func MaximumNArgs(n int) PositionalArgs {","file":"args.go","line":97,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 77: func maximumNArgsWithMoreArgs(err error, t *testing.T) {","file":"args_test.go","line":77,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 269: // MaximumNArgs","file":"args_test.go","line":269,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 271: func TestMaximumNArgs(t *testing.T) {","file":"args_test.go","line":271,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 272: c := getCommand(MaximumNArgs(3), false)","file":"args_test.go","line":272,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 277: func TestMaximumNArgs_WithValid(t *testing.T) {","file":"args_test.go","line":277,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 278: c := getCommand(MaximumNArgs(2), true)","file":"args_test.go","line":278,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 283: func TestMaximumNArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":283,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 284: c := getCommand(MaximumNArgs(2), true)","file":"args_test.go","line":284,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 289: func TestMaximumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":289,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 290: c := getCommand(MatchAll(OnlyValidArgs, MaximumNArgs(2)), true)","file":"args_test.go","line":290,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 295: func TestMaximumNArgs_WithMoreArgs(t *testing.T) {","file":"args_test.go","line":295,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 296: c := getCommand(MaximumNArgs(2), false)","file":"args_test.go","line":296,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 298: maximumNArgsWithMoreArgs(err, t)","file":"args_test.go","line":298,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 301: func TestMaximumNArgs_WithMoreArgs_WithValid(t *testing.T) {","file":"args_test.go","line":301,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 302: c := getCommand(MaximumNArgs(2), true)","file":"args_test.go","line":302,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 304: maximumNArgsWithMoreArgs(err, t)","file":"args_test.go","line":304,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 307: func TestMaximumNArgs_WithMoreArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":307,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 308: c := getCommand(MaximumNArgs(2), true)","file":"args_test.go","line":308,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 310: maximumNArgsWithMoreArgs(err, t)","file":"args_test.go","line":310,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 313: func TestMaximumNArgs_WithMoreArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":313,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 314: c := getCommand(MatchAll(OnlyValidArgs, MaximumNArgs(2)), true)","file":"args_test.go","line":314,"lexical":0.65,"target":false},{"text":"File: site/content/user_guide.md\nLine 445: - `MaximumNArgs(int)` - report an error if more than N positional args are provided.","file":"site/content/user_guide.md","line":445,"lexical":0.55,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"명령어 별칭이 전체 이름이 아니라 앞부분만 일치해도 실행되는지 확인하는 테스트 코드가 어디에 있나요? 특히 접두사 매칭 옵션을 켜고 테스트하는 부분을 찾고 싶습니다.","query":"alias prefix matching","file":"command_test.go","symbol":"TestAliasPrefixMatching","line":334,"lang":"ko","candidates":[{"text":"File: command.go\nLine 805: if EnablePrefixMatching && cmd.hasNameOrAliasPrefix(next) {","file":"command.go","line":805,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 334: func TestAliasPrefixMatching(t *testing.T) {","file":"command_test.go","line":334,"lexical":0.44999999999999996,"target":true}]} | |
| {"site":"project_search","repo":"cobra","task":"Verifique se a validação dos argumentos mínimos funciona corretamente quando o número de argumentos fornecidos é suficiente ou excede o mínimo exigido. O teste deve confirmar que a execução do comando com argumentos válidos não gera erro.","query":"minimum args valid test","file":"args_test.go","symbol":"TestMinimumNArgs_WithValid","line":227,"lang":"pt","candidates":[{"text":"File: args_test.go\nLine 227: func TestMinimumNArgs_WithValid(t *testing.T) {","file":"args_test.go","line":227,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 233: func TestMinimumNArgs_WithValid__WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":233,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 239: func TestMinimumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":239,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 251: func TestMinimumNArgs_WithLessArgs_WithValid(t *testing.T) {","file":"args_test.go","line":251,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 257: func TestMinimumNArgs_WithLessArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":257,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 263: func TestMinimumNArgs_WithLessArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":263,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"O teste que verifica o comportamento de quando passamos argumentos inválidos para o comando de intervalo está falhando ou não está cobrindo o cenário de erro esperado ao receber strings em vez de números.","query":"range args test","file":"args_test.go","symbol":"TestRangeArgs_WithValid_WithInvalidArgs","line":383,"lang":"pt","candidates":[{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 371: func TestRangeArgs(t *testing.T) {","file":"args_test.go","line":371,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 377: func TestRangeArgs_WithValid(t *testing.T) {","file":"args_test.go","line":377,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 383: func TestRangeArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":383,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 389: func TestRangeArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":389,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 395: func TestRangeArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":395,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 401: func TestRangeArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":401,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 407: func TestRangeArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":407,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 413: func TestRangeArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":413,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"como eu crio um item de autocompletar que inclua uma descrição usando tabulação?","query":"completion tab description","file":"completions.go","symbol":"CompletionWithDesc","line":142,"lang":"pt","candidates":[{"text":"File: completions.go\nLine 131: // - the completion choice with a textual description (separated by a TAB).","file":"completions.go","line":131,"lexical":0.65,"target":true},{"text":"File: completions.go\nLine 141: // CompletionWithDesc returns a [Completion] with a description by using the TAB delimited format.","file":"completions.go","line":141,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"コマンドの前にフラグを指定した場合の動作を確認するテストを見つけたいんです。","query":"flag before command","file":"command_test.go","symbol":"TestFlagBeforeCommand","line":616,"lang":"ja","candidates":[{"text":"File: command.go\nLine 229: // TraverseChildren parses flags on all parents before executing child command.","file":"command.go","line":229,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 616: func TestFlagBeforeCommand(t *testing.T) {","file":"command_test.go","line":616,"lexical":0.65,"target":true},{"text":"File: command_test.go\nLine 1841: t.Error(\"Normalization function should be passed on to inherited flag set in command added before flag\")","file":"command_test.go","line":1841,"lexical":0.65,"target":false},{"text":"File: site/content/user_guide.md\nLine 288: parse local flags on each command before executing the target command.","file":"site/content/user_guide.md","line":288,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"reStructuredText形式の出力を生成する関数を探して","query":"gen rest","file":"doc/rest_docs.go","symbol":"GenReST","line":57,"lang":"ja","candidates":[{"text":"File: doc/rest_docs.go\nLine 56: // GenReST creates reStructured Text output.","file":"doc/rest_docs.go","line":56,"lexical":0.6000000000000001,"target":true},{"text":"File: doc/rest_docs.go\nLine 57: func GenReST(cmd *cobra.Command, w io.Writer) error {","file":"doc/rest_docs.go","line":57,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 58: return GenReSTCustom(cmd, w, defaultLinkHandler)","file":"doc/rest_docs.go","line":58,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 61: // GenReSTCustom creates custom reStructured Text output.","file":"doc/rest_docs.go","line":61,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 62: func GenReSTCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string, string) string) error {","file":"doc/rest_docs.go","line":62,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 132: // GenReSTTree will generate a ReST page for this command and all","file":"doc/rest_docs.go","line":132,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 138: func GenReSTTree(cmd *cobra.Command, dir string) error {","file":"doc/rest_docs.go","line":138,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 140: return GenReSTTreeCustom(cmd, dir, emptyStr, defaultLinkHandler)","file":"doc/rest_docs.go","line":140,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 143: // GenReSTTreeCustom is the same as GenReSTTree, but","file":"doc/rest_docs.go","line":143,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 145: func GenReSTTreeCustom(cmd *cobra.Command, dir string, filePrepender func(string) string, linkHandler func(string, string) string) error {","file":"doc/rest_docs.go","line":145,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 150: if err := GenReSTTreeCustom(c, dir, filePrepender, linkHandler); err != nil {","file":"doc/rest_docs.go","line":150,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs.go\nLine 166: if err := GenReSTCustom(cmd, f, linkHandler); err != nil {","file":"doc/rest_docs.go","line":166,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs_test.go\nLine 29: if err := GenReST(echoCmd, buf); err != nil {","file":"doc/rest_docs_test.go","line":29,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs_test.go\nLine 51: if err := GenReST(echoCmd, buf); err != nil {","file":"doc/rest_docs_test.go","line":51,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs_test.go\nLine 71: if err := GenReST(rootCmd, buf); err != nil {","file":"doc/rest_docs_test.go","line":71,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs_test.go\nLine 89: if err := GenReSTTree(c, tmpdir); err != nil {","file":"doc/rest_docs_test.go","line":89,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs_test.go\nLine 90: t.Fatalf(\"GenReSTTree failed: %s\", err.Error())","file":"doc/rest_docs_test.go","line":90,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs_test.go\nLine 98: func BenchmarkGenReSTToFile(b *testing.B) {","file":"doc/rest_docs_test.go","line":98,"lexical":0.6000000000000001,"target":false},{"text":"File: doc/rest_docs_test.go\nLine 108: if err := GenReST(rootCmd, file); err != nil {","file":"doc/rest_docs_test.go","line":108,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 1: # Generating ReStructured Text Docs For Your Own cobra.Command","file":"site/content/docgen/rest.md","line":1,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 3: Generating ReST pages from a cobra command is incredibly easy. An example is as follows:","file":"site/content/docgen/rest.md","line":3,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 20: err := doc.GenReSTTree(cmd, \"/tmp\")","file":"site/content/docgen/rest.md","line":20,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 29: ## Generate ReST docs for the entire command tree","file":"site/content/docgen/rest.md","line":29,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 49: err := doc.GenReSTTree(kubectl, \"./\")","file":"site/content/docgen/rest.md","line":49,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 58: ## Generate ReST docs for a single command","file":"site/content/docgen/rest.md","line":58,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 60: You may wish to have more control over the output, or only generate for a single command, instead of the entire command tree. If this is the case you may prefer to `GenReST` instead of `GenReSTTree`","file":"site/content/docgen/rest.md","line":60,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 64: err := doc.GenReST(cmd, out)","file":"site/content/docgen/rest.md","line":64,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 74: Both `GenReST` and `GenReSTTree` have alternate versions with callbacks to get some control of the output:","file":"site/content/docgen/rest.md","line":74,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 77: func GenReSTTreeCustom(cmd *Command, dir string, filePrepender func(string) string, linkHandler func(string, string) string) error {","file":"site/content/docgen/rest.md","line":77,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 83: func GenReSTCustom(cmd *Command, out *bytes.Buffer, linkHandler func(string, string) string) error {","file":"site/content/docgen/rest.md","line":83,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/docgen/rest.md\nLine 88: The `filePrepender` will prepend the return value given the full filepath to the rendered ReST file. A common use case is to add front matter to use the generated documentation with [Hugo](https://gohugo.io/):","file":"site/content/docgen/rest.md","line":88,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"I am working on sanitizing environment variable names for configuration prefixes. Please help me find the regular expression that matches any character not being an uppercase letter, digit, or underscore.","query":"config env var prefix","file":"completions.go","symbol":"configEnvVarPrefixSubstRegexp","line":1001,"lang":"en","candidates":[{"text":"File: active_help.go\nLine 27: activeHelpGlobalEnvVar = configEnvVarGlobalPrefix + \"_\" + activeHelpEnvVarSuffix","file":"active_help.go","line":27,"lexical":0.5,"target":false},{"text":"File: completions.go\nLine 997: configEnvVarGlobalPrefix = \"COBRA\"","file":"completions.go","line":997,"lexical":0.5,"target":true},{"text":"File: completions.go\nLine 1001: var configEnvVarPrefixSubstRegexp = regexp.MustCompile(`[^A-Z0-9_]`)","file":"completions.go","line":1001,"lexical":0.5,"target":false},{"text":"File: completions.go\nLine 1009: v = configEnvVarPrefixSubstRegexp.ReplaceAllString(v, \"_\")","file":"completions.go","line":1009,"lexical":0.5,"target":false},{"text":"File: completions.go\nLine 1021: v = os.Getenv(configEnvVar(configEnvVarGlobalPrefix, suffix))","file":"completions.go","line":1021,"lexical":0.5,"target":false},{"text":"File: completions_test.go\nLine 3836: globalDescriptionsEnvVar := configEnvVar(configEnvVarGlobalPrefix, configEnvVarSuffixDescriptions)","file":"completions_test.go","line":3836,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"suche die konstante für das deaktivieren der beschreibungen bei der vervollständigung","query":"disable completion descriptions","file":"completions.go","symbol":"compCmdNoDescFlagDesc","line":102,"lang":"de","candidates":[{"text":"File: completions.go\nLine 102: compCmdNoDescFlagDesc = \"disable completion descriptions\"","file":"completions.go","line":102,"lexical":0.65,"target":true},{"text":"File: completions.go\nLine 113: // DisableDescriptions turns off all completion descriptions for shells","file":"completions.go","line":113,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 760: haveNoDescFlag := !c.CompletionOptions.DisableNoDescFlag && !c.CompletionOptions.DisableDescriptions","file":"completions.go","line":760,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 802: noDesc := c.CompletionOptions.DisableDescriptions","file":"completions.go","line":802,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2532: // Test that completion descriptions can be disabled completely","file":"completions_test.go","line":2532,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2533: rootCmd.CompletionOptions.DisableDescriptions = true","file":"completions_test.go","line":2533,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2541: rootCmd.CompletionOptions.DisableDescriptions = false","file":"completions_test.go","line":2541,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2576: rootCmd.CompletionOptions.DisableDescriptions = true","file":"completions_test.go","line":2576,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2587: rootCmd.CompletionOptions.DisableDescriptions = false","file":"completions_test.go","line":2587,"lexical":0.65,"target":false},{"text":"File: site/content/completions/_index.md\nLine 113: To tell Cobra to completely disable descriptions for completions:","file":"site/content/completions/_index.md","line":113,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 115: rootCmd.CompletionOptions.DisableDescriptions = true","file":"site/content/completions/_index.md","line":115,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 421: If you don't want to show descriptions in the completions, you can add `--no-descriptions` to the default `completion` command to disable them, like:","file":"site/content/completions/_index.md","line":421,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 513: *Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`.","file":"site/content/completions/_index.md","line":513,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 539: *Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`.","file":"site/content/completions/_index.md","line":539,"lexical":0.55,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"중복된 인자가 들어왔을 때 에러가 발생하는지 확인하는 테스트 찾아줘","query":"duplicate args error","file":"args_test.go","symbol":"TestNoDuplicateArgs_WithValid_WithDuplicateArgs","line":181,"lang":"ko","candidates":[{"text":"File: args.go\nLine 68: // NoDuplicateArgs returns an error if there are any duplicate positional args.","file":"args.go","line":68,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 69: func NoDuplicateArgs(cmd *Command, args []string) error {","file":"args.go","line":69,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 110: func noDuplicateArgsWithDuplicate(err error, t *testing.T, arg string) {","file":"args_test.go","line":110,"lexical":0.65,"target":true},{"text":"File: site/content/user_guide.md\nLine 450: - `NoDuplicateArgs` - report an error if any positional argument value is provided more than once.","file":"site/content/user_guide.md","line":450,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"验证扫描器读取的下一行文本是否等于指定字符串","query":"scan line assert","file":"doc/man_docs_test.go","symbol":"assertNextLineEquals","line":201,"lang":"zh","candidates":[{"text":"File: doc/man_docs_test.go\nLine 141: if err := assertLineFound(scanner, \".SH SEE ALSO\"); err != nil {","file":"doc/man_docs_test.go","line":141,"lexical":0.44999999999999996,"target":true},{"text":"File: doc/man_docs_test.go\nLine 144: if err := assertNextLineEquals(scanner, `\\fBroot-bbb(1)\\fP, \\fBroot-ccc(1)\\fP`); err != nil {","file":"doc/man_docs_test.go","line":144,"lexical":0.44999999999999996,"target":false},{"text":"File: doc/man_docs_test.go\nLine 186: func assertLineFound(scanner *bufio.Scanner, expectedLine string) error {","file":"doc/man_docs_test.go","line":186,"lexical":0.44999999999999996,"target":false},{"text":"File: doc/man_docs_test.go\nLine 201: func assertNextLineEquals(scanner *bufio.Scanner, expectedLine string) error {","file":"doc/man_docs_test.go","line":201,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"O comando falha ao tentar executar uma instrução quando a configuração está definida para aceitar apenas argumentos válidos, mas um valor inválido é passado.","query":"invalid args error","file":"args_test.go","symbol":"TestArbitraryArgs_WithValidOnly_WithInvalidArgs","line":213,"lang":"pt","candidates":[{"text":"File: args.go\nLine 61: return fmt.Errorf(\"invalid argument %q for %q%s\", v, cmd.CommandPath(), cmd.findSuggestions(args[0]))","file":"args.go","line":61,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 44: func validOnlyWithInvalidArgs(err error, t *testing.T) {","file":"args_test.go","line":44,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 88: func exactArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":88,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":false},{"text":"File: site/content/user_guide.md\nLine 484: return fmt.Errorf(\"invalid color specified: %s\", args[0])","file":"site/content/user_guide.md","line":484,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"필수 플래그가 누락되었을 때 자동 완성 목록에 추가해 주는 로직 어디 있어?","query":"required flag completion","file":"completions.go","symbol":"completeRequireFlags","line":632,"lang":"ko","candidates":[{"text":"File: bash_completions.go\nLine 32: BashCompOneRequiredFlag = \"cobra_annotation_bash_completion_one_required_flag\"","file":"bash_completions.go","line":32,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 844: func TestRequiredFlagNameCompletionInGo(t *testing.T) {","file":"completions_test.go","line":844,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1019: // Test that when all required flags are present, normal completion is done","file":"completions_test.go","line":1019,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3157: func TestCompletionForOneRequiredGroupFlags(t *testing.T) {","file":"completions_test.go","line":3157,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 21: // MarkFlagRequired instructs the various shell completion implementations to","file":"shell_completions.go","line":21,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 28: // MarkPersistentFlagRequired instructs the various shell completion implementations to","file":"shell_completions.go","line":28,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 35: // MarkFlagRequired instructs the various shell completion implementations to","file":"shell_completions.go","line":35,"lexical":0.65,"target":false},{"text":"File: site/content/completions/_index.md\nLine 277: Most of the time completions will only show sub-commands. But if a flag is required to make a sub-command work, you probably want it to show up when the user types [tab][tab]. You can mark a flag as 'Required' like so:","file":"site/content/completions/_index.md","line":277,"lexical":0.55,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Comment l'endroit où sont gérées les règles de groupes de flags (exclusivité mutuelle ou présence obligatoire) ?","query":"validate flag groups","file":"flag_groups.go","symbol":"ValidateFlagGroups","line":81,"lang":"fr","candidates":[{"text":"File: command.go\nLine 1010: if err := c.ValidateFlagGroups(); err != nil {","file":"command.go","line":1010,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups.go\nLine 79: // ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the","file":"flag_groups.go","line":79,"lexical":0.65,"target":true},{"text":"File: flag_groups.go\nLine 81: func (c *Command) ValidateFlagGroups() error {","file":"flag_groups.go","line":81,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 99: if err := validateRequiredFlagGroups(groupStatus); err != nil {","file":"flag_groups.go","line":99,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 102: if err := validateOneRequiredFlagGroups(oneRequiredGroupStatus); err != nil {","file":"flag_groups.go","line":102,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 105: if err := validateExclusiveFlagGroups(mutuallyExclusiveGroupStatus); err != nil {","file":"flag_groups.go","line":105,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 144: func validateRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":144,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 167: func validateOneRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":167,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 188: func validateExclusiveFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":188,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 22: func TestValidateFlagGroups(t *testing.T) {","file":"flag_groups_test.go","line":22,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"run tests with richgo","query":"richgo test","file":"Makefile","symbol":"richtest","line":26,"lang":"en","candidates":[{"text":"File: Makefile\nLine 27: $(info ******************** running tests with kyoh86/richgo ********************)","file":"Makefile","line":27,"lexical":0.39999999999999997,"target":true},{"text":"File: Makefile\nLine 28: richgo test -v $(GO_TEST_FLAGS) ./...","file":"Makefile","line":28,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"텍스트 입력을 한 줄씩 읽으면서 특정 문자열이 포함되어 있는지 확인하고, 찾지 못하거나 읽기 오류가 발생했을 때 에러를 반환하는 로직을 찾아주세요.","query":"scanner scan line","file":"doc/man_docs_test.go","symbol":"assertLineFound","line":186,"lang":"ko","candidates":[{"text":"File: doc/man_docs_test.go\nLine 141: if err := assertLineFound(scanner, \".SH SEE ALSO\"); err != nil {","file":"doc/man_docs_test.go","line":141,"lexical":0.44999999999999996,"target":true},{"text":"File: doc/man_docs_test.go\nLine 144: if err := assertNextLineEquals(scanner, `\\fBroot-bbb(1)\\fP, \\fBroot-ccc(1)\\fP`); err != nil {","file":"doc/man_docs_test.go","line":144,"lexical":0.44999999999999996,"target":false},{"text":"File: doc/man_docs_test.go\nLine 186: func assertLineFound(scanner *bufio.Scanner, expectedLine string) error {","file":"doc/man_docs_test.go","line":186,"lexical":0.44999999999999996,"target":false},{"text":"File: doc/man_docs_test.go\nLine 188: line := scanner.Text()","file":"doc/man_docs_test.go","line":188,"lexical":0.44999999999999996,"target":false},{"text":"File: doc/man_docs_test.go\nLine 201: func assertNextLineEquals(scanner *bufio.Scanner, expectedLine string) error {","file":"doc/man_docs_test.go","line":201,"lexical":0.44999999999999996,"target":false},{"text":"File: doc/man_docs_test.go\nLine 203: line := scanner.Text()","file":"doc/man_docs_test.go","line":203,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"ExactArgs 검증에서 제공된 인수 개수가 기대치와 다를 때 에러가 발생했는지 확인하는 테스트 코드를 찾아줘.","query":"exact args invalid count test","file":"args_test.go","symbol":"TestExactArgs_WithInvalidCount_WithValid_WithInvalidArgs","line":357,"lang":"ko","candidates":[{"text":"File: args_test.go\nLine 88: func exactArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":88,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 345: func TestExactArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":345,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 351: func TestExactArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":351,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 357: func TestExactArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":357,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 363: func TestExactArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":363,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 533: func TestExactValidArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":533,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 539: func TestExactValidArgs_WithInvalidCount_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":539,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Estou tentando entender como o sistema identifica se o usuário está digitando o nome de uma opção ou o valor dela durante o autocompletar. Pode me mostrar a lógica que separa flags curtas de longas quando há um sinal de igual?","query":"flag completion parsing","file":"completions.go","symbol":"checkIfFlagCompletion","line":657,"lang":"pt","candidates":[{"text":"File: bash_completions.go\nLine 229: # we are parsing a flag and don't have a special handler, no completion","file":"bash_completions.go","line":229,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 361: // Check if we are doing flag value completion before parsing the flags.","file":"completions.go","line":361,"lexical":0.65,"target":true},{"text":"File: completions.go\nLine 377: return finalCmd, []Completion{}, ShellCompDirectiveDefault, fmt.Errorf(\"Error while parsing flags from args %v: %s\", finalArgs, err.Error())","file":"completions.go","line":377,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 435: // Note that we want to perform flagname completion even if finalCmd.DisableFlagParsing==true;","file":"completions.go","line":435,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 436: // doing this allows for completion of persistent flag names even for commands that disable flag parsing.","file":"completions.go","line":436,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3546: desc: \"no completion for --help/-h and --version/-v flags when DisableFlagParsing=true\",","file":"completions_test.go","line":3546,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3554: desc: \"completions for program-defined --help/-h and --version/-v flags even when DisableFlagParsing=true\",","file":"completions_test.go","line":3554,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Ich arbeite gerade an der Validierung der Konfigurationsparameter. Gibt es eine Hilfsfunktion, die prüft, ob ein bestimmter Textwert in einer Liste von erlaubten Optionen enthalten ist?","query":"string in slice","file":"cobra.go","symbol":"stringInSlice","line":225,"lang":"de","candidates":[{"text":"File: args.go\nLine 60: if !stringInSlice(v, validArgs) {","file":"args.go","line":60,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra.go\nLine 112: // Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as","file":"cobra.go","line":112,"lexical":0.44999999999999996,"target":true},{"text":"File: cobra.go\nLine 225: func stringInSlice(a string, list []string) bool {","file":"cobra.go","line":225,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra_test.go\nLine 121: func TestStringInSlice(t *testing.T) {","file":"cobra_test.go","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra_test.go\nLine 129: name: \"String in slice (case-sensitive)\",","file":"cobra_test.go","line":129,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra_test.go\nLine 135: name: \"String not in slice (case-sensitive)\",","file":"cobra_test.go","line":135,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra_test.go\nLine 141: name: \"String in slice (case-insensitive)\",","file":"cobra_test.go","line":141,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra_test.go\nLine 165: name: \"Empty string in empty slice\",","file":"cobra_test.go","line":165,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra_test.go\nLine 175: got := stringInSlice(tt.a, tt.list)","file":"cobra_test.go","line":175,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra_test.go\nLine 179: t.Errorf(\"Expected stringInSlice: %v\\nGot: %v\", tt.expected, got)","file":"cobra_test.go","line":179,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2283: if stringInSlice(f.Name, names) {","file":"command_test.go","line":2283,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 312: // GetSlice returns the flag value list as an array of strings.","file":"completions.go","line":312,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 313: GetSlice() []string","file":"completions.go","line":313,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 450: strings.Contains(flag.Value.Type(), \"Slice\") ||","file":"completions.go","line":450,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 455: // If the flag is not already present, or if it can be specified multiple times (Array, Slice, or stringTo)","file":"completions.go","line":455,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 675: // but does not include \"Slice\" or \"Array\" in its \"Type\" string.","file":"completions_test.go","line":675,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 678: var _ SliceValue = (*customMultiString)(nil)","file":"completions_test.go","line":678,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 693: func (s *customMultiString) GetSlice() []string {","file":"completions_test.go","line":693,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 424: // Alternative: StringSliceVarP for comma-separated values","file":"site/content/user_guide.md","line":424,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 425: // rootCmd.Flags().StringSliceVarP(&inputFiles, \"input\", \"i\", []string{}, \"input files (comma-separated or repeated)\")","file":"site/content/user_guide.md","line":425,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 432: - With StringSlice: `myapp --input file1.txt,file2.txt,file3.txt`","file":"site/content/user_guide.md","line":432,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Verifique o teste que valida o comportamento quando um contador inválido é fornecido para RangeArgs.","query":"range args invalid count test","file":"args_test.go","symbol":"TestRangeArgs_WithInvalidCount","line":395,"lang":"pt","candidates":[{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 395: func TestRangeArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":395,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 401: func TestRangeArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":401,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 407: func TestRangeArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":407,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 413: func TestRangeArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":413,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Je cherche la valeur utilisée pour désigner l'option qui doit rester invisible dans les tests de complétion. Peux-tu me dire quel est le nom de ce drapeau ?","query":"hiddenFlag","file":"bash_completions_test.go","symbol":"flagName","line":232,"lang":"fr","candidates":[{"text":"File: bash_completions_test.go\nLine 229: func TestBashCompletionHiddenFlag(t *testing.T) {","file":"bash_completions_test.go","line":229,"lexical":0.35,"target":true},{"text":"File: bash_completions_test.go\nLine 232: const flagName = \"hiddenFlag\"","file":"bash_completions_test.go","line":232,"lexical":0.35,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"최상위 명령에 정의되지 않은 인자가 전달되었을 때 에러가 발생하는지 확인하는 테스트 코드가 어디 있지?","query":"unknown command error","file":"args_test.go","symbol":"TestRootTakesNoArgs","line":421,"lang":"ko","candidates":[{"text":"File: args.go\nLine 36: return fmt.Errorf(\"unknown command %q for %q%s\", args[0], cmd.CommandPath(), cmd.findSuggestions(args[0]))","file":"args.go","line":36,"lexical":0.44999999999999996,"target":false},{"text":"File: args.go\nLine 44: return fmt.Errorf(\"unknown command %q for %q\", args[0], cmd.CommandPath())","file":"args.go","line":44,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 152: expected := \"Error: unknown command \\\"unknown\\\" for \\\"root\\\"\\nRun 'root --help' for usage.\\n\"","file":"command_test.go","line":152,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1440: templateWithSuggestions := \"Error: unknown command \\\"%s\\\" for \\\"root\\\"\\n\\nDid you mean this?\\n\\t%s\\n\\nRun 'root --help' for usage.\\n\"","file":"command_test.go","line":1440,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1441: templateWithoutSuggestions := \"Error: unknown command \\\"%s\\\" for \\\"root\\\"\\nRun 'root --help' for usage.\\n\"","file":"command_test.go","line":1441,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2884: // {\"--unknown\", \"--namespace\", \"foo\", \"child\", \"--bar\"}, // FIXME: This test case fails, returning the error `unknown command \"foo\" for \"root\"` instead of the expected error `unknown flag: --unknown`","file":"command_test.go","line":2884,"lexical":0.65,"target":false},{"text":"File: site/content/user_guide.md\nLine 779: Cobra will print automatic suggestions when \"unknown command\" errors happen. This allows Cobra to behave similarly to the `git` command when a typo happens. For example:","file":"site/content/user_guide.md","line":779,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 783: Error: unknown command \"srever\" for \"hugo\"","file":"site/content/user_guide.md","line":783,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 810: Error: unknown command \"remove\" for \"kubectl\"","file":"site/content/user_guide.md","line":810,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"définir le modèle d'utilisation du commande","query":"set usage template","file":"command.go","symbol":"SetUsageTemplate","line":318,"lang":"fr","candidates":[{"text":"File: cobra_test.go\nLine 41: c.SetUsageTemplate(`{{if t}}{{h}}{{end}}{{if f}}{{h}}{{end}} {{w}}`)","file":"cobra_test.go","line":41,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 317: // SetUsageTemplate sets usage template. Can be defined by Application.","file":"command.go","line":317,"lexical":0.44999999999999996,"target":true},{"text":"File: command.go\nLine 318: func (c *Command) SetUsageTemplate(s string) {","file":"command.go","line":318,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1129: func TestSetUsageTemplate(t *testing.T) {","file":"command_test.go","line":1129,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1134: rootCmd.SetUsageTemplate(\"WORKS {{.UseLine}}\")","file":"command_test.go","line":1134,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1155: // Reset the root command usage template and make sure","file":"command_test.go","line":1155,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1157: rootCmd.SetUsageTemplate(\"\")","file":"command_test.go","line":1157,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 666: cmd.SetUsageTemplate(s string)","file":"site/content/user_guide.md","line":666,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 669: Note that templates specified with `SetUsageTemplate` are evaluated using","file":"site/content/user_guide.md","line":669,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"检查字符串是否不期望包含特定子串并报错","query":"test omit string","file":"doc/cmd_test.go","symbol":"checkStringOmits","line":101,"lang":"zh","candidates":[{"text":"File: bash_completions_test.go\nLine 27: func checkOmit(t *testing.T, found, unexpected string) {","file":"bash_completions_test.go","line":27,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 80: func checkStringOmits(t *testing.T, got, expected string) {","file":"command_test.go","line":80,"lexical":0.65,"target":false},{"text":"File: doc/cmd_test.go\nLine 101: func checkStringOmits(t *testing.T, got, expected string) {","file":"doc/cmd_test.go","line":101,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"cobra","task":"Hay un problema: algunos comandos están activando sugerencias de rutas de archivos de forma inesperada. Necesito encontrar la función que se utiliza para desactivar explícitamente el autocompletado de archivos y asegurar que devuelva la directiva de no permitir archivos.","query":"disable file completion","file":"completions.go","symbol":"NoFileCompletions","line":151,"lang":"es","candidates":[{"text":"File: completions.go\nLine 146: // NoFileCompletions can be used to disable file completion for commands that should","file":"completions.go","line":146,"lexical":0.65,"target":true},{"text":"File: fish_completions.go\nLine 201: # If we want to prevent a space, or if file completion is NOT disabled,","file":"fish_completions.go","line":201,"lexical":0.65,"target":false},{"text":"File: zsh_completions.go\nLine 49: // default for every argument. One can disable file completion on a per-argument","file":"zsh_completions.go","line":49,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"셸 완성 스크립트에서 설명 없이 결과만 요청할 때 사용하는 내부 명령어가 무엇인가요?","query":"shell completion command","file":"completions.go","symbol":"ShellCompNoDescRequestCmd","line":34,"lang":"ko","candidates":[{"text":"File: active_help_test.go\nLine 240: _ = rootCmd.RegisterFlagCompletionFunc(flagname, func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":240,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 305: _ = childCmd.RegisterFlagCompletionFunc(flagname, func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":305,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 1109: // initialize the __complete command to be used for shell completion","file":"command.go","line":1109,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1274: ValidArgsFunction: func(c *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) {","file":"command.go","line":1274,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 139: type CompletionFunc = func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective)","file":"completions.go","line":139,"lexical":0.65,"target":true},{"text":"File: completions.go\nLine 151: func NoFileCompletions(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) {","file":"completions.go","line":151,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 161: return func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) {","file":"completions.go","line":161,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 239: Short: \"Request shell completion choices for the specified command-line\",","file":"completions.go","line":239,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 240: Long: fmt.Sprintf(\"%[2]s is a special command that is used by the shell completion logic\\n%[1]s\",","file":"completions.go","line":240,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 241: \"to request completion choices for the specified command-line.\", ShellCompRequestCmd),","file":"completions.go","line":241,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 316: func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCompDirective, error) {","file":"completions.go","line":316,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 347: return c, []Completion{}, ShellCompDirectiveDefault, fmt.Errorf(\"unable to find a command for arguments: %v\", trimmedArgs)","file":"completions.go","line":347,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 929: completionCmd.AddCommand(bash, zsh, fish, powershell)","file":"completions.go","line":929,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1630: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"introot\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":1630,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1640: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"filename\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":1640,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1838: _ = childCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":1838,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2055: _ = childCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2055,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2082: _ = rootCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2082,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2152: _ = cmd.RegisterFlagCompletionFunc(flagName, func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2152,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2193: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"introot\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2193,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2203: assertNoErr(t, rootCmd.RegisterFlagCompletionFunc(\"filename\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2203,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2612: output, err := executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"completion\")","file":"completions_test.go","line":2612,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2627: output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"completion\", \"\")","file":"completions_test.go","line":2627,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2652: output, err = executeCommand(rootCmd, ShellCompNoDescRequestCmd, \"completion\", \"\")","file":"completions_test.go","line":2652,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2704: _ = rootCmd.RegisterFlagCompletionFunc(\"short3\", func(*Command, []string, string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2704,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2913: var userComp func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective)","file":"completions_test.go","line":2913,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2930: var _ func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) = userComp //nolint:staticcheck // LHS type is needed for this use case","file":"completions_test.go","line":2930,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2946: type UserCompletionTypeHelper func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)","file":"completions_test.go","line":2946,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2964: type UserCompletionTypeAliasHelper = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)","file":"completions_test.go","line":2964,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3651: _ = rootCmd.RegisterFlagCompletionFunc(\"rootflag\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3651,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3656: _ = rootCmd.RegisterFlagCompletionFunc(\"persistentflag\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3656,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3663: _ = childCmd.RegisterFlagCompletionFunc(\"childflag\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3663,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"busca la prueba de completar argumentos con descripciones en subcomandos","query":"test valid args desc","file":"completions_test.go","symbol":"TestValidArgsFuncChildCmdsWithDesc","line":1717,"lang":"es","candidates":[{"text":"File: completions_test.go\nLine 476: // Test that both sub-commands and validArgs are completed with description","file":"completions_test.go","line":476,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 1717: func TestValidArgsFuncChildCmdsWithDesc(t *testing.T) {","file":"completions_test.go","line":1717,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"检查在执行带有数值区间范围参数的命令时,是否能够正确接收并处理后续传入的变长字符串参数,确保在指定起止范围后,外部输入的多个值不会导致执行失败。","query":"range args test","file":"args_test.go","symbol":"TestRangeArgs","line":371,"lang":"zh","candidates":[{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 371: func TestRangeArgs(t *testing.T) {","file":"args_test.go","line":371,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 377: func TestRangeArgs_WithValid(t *testing.T) {","file":"args_test.go","line":377,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 383: func TestRangeArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":383,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 389: func TestRangeArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":389,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 395: func TestRangeArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":395,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 401: func TestRangeArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":401,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 407: func TestRangeArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":407,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 413: func TestRangeArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":413,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"파워쉘 자동 완성 파일 생성하는 메서드 어디 있어?","query":"powershell completion generate","file":"powershell_completions.go","symbol":"GenPowerShellCompletionFile","line":331,"lang":"ko","candidates":[{"text":"File: completions.go\nLine 906: Long: fmt.Sprintf(`Generate the autocompletion script for powershell.","file":"completions.go","line":906,"lexical":0.65,"target":false},{"text":"File: powershell_completions.go\nLine 330: // GenPowerShellCompletionFile generates powershell completion file without descriptions.","file":"powershell_completions.go","line":330,"lexical":0.65,"target":true},{"text":"File: powershell_completions.go\nLine 335: // GenPowerShellCompletion generates powershell completion file without descriptions","file":"powershell_completions.go","line":335,"lexical":0.65,"target":false},{"text":"File: powershell_completions.go\nLine 341: // GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions.","file":"powershell_completions.go","line":341,"lexical":0.65,"target":false},{"text":"File: powershell_completions.go\nLine 346: // GenPowerShellCompletionWithDesc generates powershell completion file with descriptions","file":"powershell_completions.go","line":346,"lexical":0.65,"target":false},{"text":"File: site/content/completions/_index.md\nLine 426: bash (generate autocompletion script for bash) powershell (generate autocompletion script for powershell)","file":"site/content/completions/_index.md","line":426,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 559: Cobra supports native PowerShell completions generated from the root `cobra.Command`. You can use the `command.GenPowerShellCompletion()` or `command.GenPowerShellCompletionFile()` functions. To include descriptions use `command.GenPowerShellCompletionWith…","file":"site/content/completions/_index.md","line":559,"lexical":0.55,"target":false},{"text":"File: site/content/user_guide.md\nLine 825: Cobra can generate a shell-completion file for the following shells: bash, zsh, fish, PowerShell.","file":"site/content/user_guide.md","line":825,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"여러 옵션 중 하나는 반드시 입력되어야 하는 제약 조건을 설정하는 과정에서, 존재하지 않는 옵션 이름을 전달할 경우 프로그램이 즉시 중단(panic)되는 현상이 있습니다. 관련 로직을 확인해 주세요.","query":"one required flag","file":"flag_groups.go","symbol":"MarkFlagsOneRequired","line":49,"lang":"ko","candidates":[{"text":"File: bash_completions.go\nLine 32: BashCompOneRequiredFlag = \"cobra_annotation_bash_completion_one_required_flag\"","file":"bash_completions.go","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completions.go\nLine 294: # if a command required a flag, and we found it, unset must_have_one_flag()","file":"bash_completions.go","line":294,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completions.go\nLine 600: if _, ok := flag.Annotations[BashCompOneRequiredFlag]; ok {","file":"bash_completions.go","line":600,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 1188: requiredAnnotation, found := pflag.Annotations[BashCompOneRequiredFlag]","file":"command.go","line":1188,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 636: if _, present := flag.Annotations[BashCompOneRequiredFlag]; present {","file":"completions.go","line":636,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 1019: // Test that when all required flags are present, normal completion is done","file":"completions_test.go","line":1019,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3157: func TestCompletionForOneRequiredGroupFlags(t *testing.T) {","file":"completions_test.go","line":3157,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3179: childCmd.MarkFlagsOneRequired(\"ingroup1\", \"ingroup2\", \"ingroup3\")","file":"completions_test.go","line":3179,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups.go\nLine 47: // MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors","file":"flag_groups.go","line":47,"lexical":0.65,"target":true},{"text":"File: flag_groups.go\nLine 49: func (c *Command) MarkFlagsOneRequired(flagNames ...string) {","file":"flag_groups.go","line":49,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 54: panic(fmt.Sprintf(\"Failed to find flag %q and mark it as being in a one-required flag group\", v))","file":"flag_groups.go","line":54,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 56: if err := c.Flags().SetAnnotation(v, oneRequiredAnnotation, append(f.Annotations[oneRequiredAnnotation], strings.Join(flagNames, \" \"))); err != nil {","file":"flag_groups.go","line":56,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 79: // ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the","file":"flag_groups.go","line":79,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 95: processFlagForGroupAnnotation(flags, pflag, oneRequiredAnnotation, oneRequiredGroupStatus)","file":"flag_groups.go","line":95,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 102: if err := validateOneRequiredFlagGroups(oneRequiredGroupStatus); err != nil {","file":"flag_groups.go","line":102,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 167: func validateOneRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":167,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 183: return fmt.Errorf(\"at least one of the flags in the group [%v] is required\", flagList)","file":"flag_groups.go","line":183,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 222: // - when none of the flags in a one-required group are present, all flags in the group will be marked required","file":"flag_groups.go","line":222,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 236: processFlagForGroupAnnotation(flags, pflag, oneRequiredAnnotation, oneRequiredGroupStatus)","file":"flag_groups.go","line":236,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 245: // One of the flags of the group is set, mark the other ones as required","file":"flag_groups.go","line":245,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 253: // If none of the flags of a one-required group are present, we make all the flags","file":"flag_groups.go","line":253,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 255: for flagList, flagnameAndStatus := range oneRequiredGroupStatus {","file":"flag_groups.go","line":255,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 48: flagGroupsOneRequired []string","file":"flag_groups_test.go","line":48,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 51: subCmdFlagGroupsOneRequired []string","file":"flag_groups_test.go","line":51,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 68: desc: \"One-required flag group not satisfied\",","file":"flag_groups_test.go","line":68,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 69: flagGroupsOneRequired: []string{\"a b\"},","file":"flag_groups_test.go","line":69,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 71: expectErr: \"at least one of the flags in the group [a b] is required\",","file":"flag_groups_test.go","line":71,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 83: desc: \"Multiple one-required flag group not satisfied returns first error\",","file":"flag_groups_test.go","line":83,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 84: flagGroupsOneRequired: []string{\"a b\", \"d e\"},","file":"flag_groups_test.go","line":84,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 86: expectErr: `at least one of the flags in the group [a b] is required`,","file":"flag_groups_test.go","line":86,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 99: flagGroupsOneRequired: []string{\"d e\", \"a b\", \"f g\"},","file":"flag_groups_test.go","line":99,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 101: expectErr: `at least one of the flags in the group [a b] is required`,","file":"flag_groups_test.go","line":101,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Estoy revisando la lógica de validación de los argumentos de los comandos. ¿Podrías mostrarme los casos de prueba donde se verifica que falle cuando se pasan más parámetros de los permitidos?","query":"test exact args invalid","file":"args_test.go","symbol":"TestExactArgs_WithInvalidCount_WithValid","line":351,"lang":"es","candidates":[{"text":"File: args_test.go\nLine 88: func exactArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":88,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 333: func TestExactArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":333,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 339: func TestExactArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":339,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 345: func TestExactArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":345,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 351: func TestExactArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":351,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 357: func TestExactArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":357,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 363: func TestExactArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":363,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 533: func TestExactValidArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":533,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 539: func TestExactValidArgs_WithInvalidCount_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":539,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 545: func TestExactValidArgs_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":545,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Gibt es einen Testfall, der prüft, ob der Befehl fehlschlägt, wenn mehrfach dieselben Argumente übergeben werden?","query":"test duplicate args","file":"args_test.go","symbol":"TestNoDuplicateArgs","line":169,"lang":"de","candidates":[{"text":"File: args_test.go\nLine 110: func noDuplicateArgsWithDuplicate(err error, t *testing.T, arg string) {","file":"args_test.go","line":110,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 169: func TestNoDuplicateArgs(t *testing.T) {","file":"args_test.go","line":169,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 175: func TestNoDuplicateArgs_WithDuplicateArgs(t *testing.T) {","file":"args_test.go","line":175,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 181: func TestNoDuplicateArgs_WithValid_WithDuplicateArgs(t *testing.T) {","file":"args_test.go","line":181,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 187: func TestNoDuplicateArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":187,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"사용자 문서와 환경 변수 설정에서 명시적으로 참조하도록 고정된 ActiveHelp 관련 환경 변수 접미사를 찾고 있어요. 이 값은 프로그램 문서에서 직접 언급되므로 변경하지 않고 사용하는 방법을 확인해야 합니다.","query":"active help env suffix","file":"active_help.go","symbol":"activeHelpEnvVarSuffix","line":26,"lang":"ko","candidates":[{"text":"File: active_help.go\nLine 26: activeHelpEnvVarSuffix = \"ACTIVE_HELP\"","file":"active_help.go","line":26,"lexical":0.65,"target":true},{"text":"File: active_help.go\nLine 27: activeHelpGlobalEnvVar = configEnvVarGlobalPrefix + \"_\" + activeHelpEnvVarSuffix","file":"active_help.go","line":27,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 59: return configEnvVar(name, activeHelpEnvVarSuffix)","file":"active_help.go","line":59,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"메인 명령어가 정의된 부분을 보여줘","query":"cobra.Command root","file":"doc/cmd_test.go","symbol":"rootCmd","line":47,"lang":"ko","candidates":[{"text":"File: cobra_test.go\nLine 268: var rootCmd = &cobra.Command{","file":"cobra_test.go","line":268,"lexical":0.39999999999999997,"target":false},{"text":"File: doc/cmd_test.go\nLine 47: var rootCmd = &cobra.Command{","file":"doc/cmd_test.go","line":47,"lexical":0.39999999999999997,"target":true},{"text":"File: doc/man_docs_test.go\nLine 128: rootCmd := &cobra.Command{Use: \"root\", Run: emptyRun}","file":"doc/man_docs_test.go","line":128,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/completions/_index.md\nLine 494: Cobra supports native zsh completion generated from the root `cobra.Command`.","file":"site/content/completions/_index.md","line":494,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/completions/_index.md\nLine 529: Cobra supports native fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions s…","file":"site/content/completions/_index.md","line":529,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/completions/_index.md\nLine 559: Cobra supports native PowerShell completions generated from the root `cobra.Command`. You can use the `command.GenPowerShellCompletion()` or `command.GenPowerShellCompletionFile()` functions. To include descriptions use `command.GenPowerShellCompletionWith…","file":"site/content/completions/_index.md","line":559,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/completions/bash.md\nLine 64: …shCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__kubectl_custom_func()` (`__<command-use>_custom_func()`) to be called when the built in processor was unable to find a solution. In the case of kube…","file":"site/content/completions/bash.md","line":64,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 47: var rootCmd = &cobra.Command{","file":"site/content/user_guide.md","line":47,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 86: rootCmd = &cobra.Command{","file":"site/content/user_guide.md","line":86,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 553: var rootCmd = &cobra.Command{Use: \"app\"}","file":"site/content/user_guide.md","line":553,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 711: var rootCmd = &cobra.Command{","file":"site/content/user_guide.md","line":711,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 854: rootCmd := &cobra.Command{","file":"site/content/user_guide.md","line":854,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Je suis en train de vérifier la gestion des paramètres de ligne de commande dans les tests. Peux-tu me montrer où est stockée la valeur entière pour le drapeau de configuration ?","query":"command test int","file":"command_test.go","symbol":"intFlagValue","line":567,"lang":"fr","candidates":[{"text":"File: bash_completions.go\nLine 453: WriteStringAndCheck(buf, fmt.Sprintf(\" commands+=(%q)\\n\", c.Name()))","file":"bash_completions.go","line":453,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completions.go\nLine 638: WriteStringAndCheck(buf, fmt.Sprintf(\" command_aliases+=(%q)\\n\", value))","file":"bash_completions.go","line":638,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completions.go\nLine 664: WriteStringAndCheck(buf, fmt.Sprintf(\"_%s_root_command()\\n{\\n\", commandName))","file":"bash_completions.go","line":664,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completions.go\nLine 666: WriteStringAndCheck(buf, fmt.Sprintf(\"_%s()\\n{\\n\", commandName))","file":"bash_completions.go","line":666,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completions.go\nLine 669: WriteStringAndCheck(buf, fmt.Sprintf(\" last_command=%q\\n\", commandName))","file":"bash_completions.go","line":669,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2177: func TestCommandPrintRedirection(t *testing.T) {","file":"command_test.go","line":2177,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"cobra","task":"Ich arbeite gerade an der Implementierung der Hilfe-Anzeige für die CLI. Kannst du mir zeigen, wie das System entscheidet, welches Layout für die Befehlsanleitung verwendet wird, wenn kein spezifisches Format definiert ist?","query":"usage template","file":"command.go","symbol":"UsageTemplate","line":592,"lang":"de","candidates":[{"text":"File: cobra.go\nLine 83: // AddTemplateFunc adds a template function that's available to Usage and Help","file":"cobra.go","line":83,"lexical":0.39999999999999997,"target":false},{"text":"File: cobra.go\nLine 89: // AddTemplateFuncs adds multiple template functions that are available to Usage and","file":"cobra.go","line":89,"lexical":0.39999999999999997,"target":false},{"text":"File: cobra_test.go\nLine 41: c.SetUsageTemplate(`{{if t}}{{h}}{{end}}{{if f}}{{h}}{{end}} {{w}}`)","file":"cobra_test.go","line":41,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 173: // usageTemplate is usage template defined by user.","file":"command.go","line":173,"lexical":0.39999999999999997,"target":true},{"text":"File: command.go\nLine 174: usageTemplate *tmplFunc","file":"command.go","line":174,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 317: // SetUsageTemplate sets usage template. Can be defined by Application.","file":"command.go","line":317,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 318: func (c *Command) SetUsageTemplate(s string) {","file":"command.go","line":318,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 320: c.usageTemplate = nil","file":"command.go","line":320,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 323: c.usageTemplate = tmpl(s)","file":"command.go","line":323,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 453: fn := c.getUsageTemplateFunc()","file":"command.go","line":453,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 462: // getUsageTemplateFunc returns the usage template function for the command","file":"command.go","line":462,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 464: func (c *Command) getUsageTemplateFunc() func(w io.Writer, data interface{}) error {","file":"command.go","line":464,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 465: if c.usageTemplate != nil {","file":"command.go","line":465,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 466: return c.usageTemplate.fn","file":"command.go","line":466,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 470: return c.parent.getUsageTemplateFunc()","file":"command.go","line":470,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 590: // UsageTemplate returns usage template for the command.","file":"command.go","line":590,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 592: func (c *Command) UsageTemplate() string {","file":"command.go","line":592,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 593: if c.usageTemplate != nil {","file":"command.go","line":593,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 594: return c.usageTemplate.tmpl","file":"command.go","line":594,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 598: return c.parent.UsageTemplate()","file":"command.go","line":598,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 600: return defaultUsageTemplate","file":"command.go","line":600,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 1646: // that need to be shown in the usage/help default template under 'additional help","file":"command.go","line":1646,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 1661: // need to be shown in the usage/help default template under 'available commands'.","file":"command.go","line":1661,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 1942: const defaultUsageTemplate = `Usage:{{if .Runnable}}","file":"command.go","line":1942,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 1973: // defaultUsageFunc is equivalent to executing defaultUsageTemplate. The two should be changed in sync.","file":"command.go","line":1973,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1129: func TestSetUsageTemplate(t *testing.T) {","file":"command_test.go","line":1129,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1134: rootCmd.SetUsageTemplate(\"WORKS {{.UseLine}}\")","file":"command_test.go","line":1134,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1136: // Trigger the usage on the root command and check the new template is used","file":"command_test.go","line":1136,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1155: // Reset the root command usage template and make sure","file":"command_test.go","line":1155,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1157: rootCmd.SetUsageTemplate(\"\")","file":"command_test.go","line":1157,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1440: templateWithSuggestions := \"Error: unknown command \\\"%s\\\" for \\\"root\\\"\\n\\nDid you mean this?\\n\\t%s\\n\\nRun 'root --help' for usage.\\n\"","file":"command_test.go","line":1440,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1441: templateWithoutSuggestions := \"Error: unknown command \\\"%s\\\" for \\\"root\\\"\\nRun 'root --help' for usage.\\n\"","file":"command_test.go","line":1441,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Estoy revisando la lógica de los comandos y necesito encontrar dónde se define este valor de cadena específico para las pruebas. ¿Podrías decirme en qué parte del código se declara esta constante de texto?","query":"\"one two\"","file":"command_test.go","symbol":"onetwo","line":86,"lang":"es","candidates":[{"text":"File: args_test.go\nLine 30: c.ValidArgs = []string{\"one\", \"two\", \"three\"}","file":"args_test.go","line":30,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 157: output, err := executeCommand(c, \"one\", \"two\")","file":"args_test.go","line":157,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 171: output, err := executeCommand(c, \"one\", \"two\")","file":"args_test.go","line":171,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 203: output, err := executeCommand(c, \"one\", \"two\")","file":"args_test.go","line":203,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 303: _, err := executeCommand(c, \"one\", \"three\", \"two\")","file":"args_test.go","line":303,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 329: output, err := executeCommand(c, \"three\", \"one\", \"two\")","file":"args_test.go","line":329,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 353: _, err := executeCommand(c, \"three\", \"one\", \"two\")","file":"args_test.go","line":353,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 379: output, err := executeCommand(c, \"three\", \"one\", \"two\")","file":"args_test.go","line":379,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 529: output, err := executeCommand(c, \"three\", \"one\", \"two\")","file":"args_test.go","line":529,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 535: _, err := executeCommand(c, \"three\", \"one\", \"two\")","file":"args_test.go","line":535,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completions_test.go\nLine 157: ValidArgs: []string{\"one\", \"two\", \"three\", \"four\"},","file":"bash_completions_test.go","line":157,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 86: const onetwo = \"one two\"","file":"command_test.go","line":86,"lexical":0.39999999999999997,"target":true},{"text":"File: command_test.go\nLine 99: output, err := executeCommand(rootCmd, \"one\", \"two\")","file":"command_test.go","line":99,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 124: output, err := executeCommand(rootCmd, \"child1\", \"one\", \"two\")","file":"command_test.go","line":124,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 291: output, err := executeCommand(rootCmd, \"tell\", \"times\", \"one\", \"two\")","file":"command_test.go","line":291,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 318: output, err := executeCommand(rootCmd, \"a\", \"one\", \"two\")","file":"command_test.go","line":318,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 353: output, err := executeCommand(rootCmd, \"sa\", \"times\", \"one\", \"two\")","file":"command_test.go","line":353,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 448: output, err := executeCommand(rootCmd, \"foo\", \"one\", \"two\")","file":"command_test.go","line":448,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 477: output, err := executeCommand(rootCmd, \"bar\", \"foo\", \"one\", \"two\")","file":"command_test.go","line":477,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 504: output, err := executeCommand(c, \"--intf=7\", \"--sf=abc\", \"one\", \"--\", \"two\")","file":"command_test.go","line":504,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 541: output, err := executeCommand(c, \"-i\", \"7\", \"-sabc\", \"one\", \"two\")","file":"command_test.go","line":541,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 751: output, err := executeCommand(rootCmd, \"-i7\", \"one\", \"two\")","file":"command_test.go","line":751,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 833: output, err := executeCommand(rootCmd, \"child\", \"-c7\", \"-p8\", \"one\", \"two\")","file":"command_test.go","line":833,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1673: output, err := executeCommand(c, \"one\", \"two\")","file":"command_test.go","line":1673,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1769: output, err := executeCommand(parentCmd, \"child\", \"one\", \"two\")","file":"command_test.go","line":1769,"lexical":0.39999999999999997,"target":false},{"text":"File: completions_test.go\nLine 325: ValidArgs: []string{\"one\", \"two\", \"three\"},","file":"completions_test.go","line":325,"lexical":0.39999999999999997,"target":false},{"text":"File: completions_test.go\nLine 379: ValidArgs: []string{\"one\", \"two\"},","file":"completions_test.go","line":379,"lexical":0.39999999999999997,"target":false},{"text":"File: completions_test.go\nLine 2283: ValidArgs: []string{\"one\", \"two\"},","file":"completions_test.go","line":2283,"lexical":0.39999999999999997,"target":false},{"text":"File: completions_test.go\nLine 2327: ValidArgs: []string{\"one\", \"two\", \"three\"},","file":"completions_test.go","line":2327,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"asigna el id de grupo al comando de ayuda","query":"help command groupid","file":"command.go","symbol":"SetHelpCommandGroupID","line":343,"lang":"es","candidates":[{"text":"File: command.go\nLine 185: // helpCommandGroupID is the group id for the helpCommand","file":"command.go","line":185,"lexical":0.65,"target":true},{"text":"File: command.go\nLine 186: helpCommandGroupID string","file":"command.go","line":186,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 342: // SetHelpCommandGroupID sets the group id of the help command.","file":"command.go","line":342,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 343: func (c *Command) SetHelpCommandGroupID(groupID string) {","file":"command.go","line":343,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 345: c.helpCommand.GroupID = groupID","file":"command.go","line":345,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 347: // helpCommandGroupID is used if no helpCommand is defined by the user","file":"command.go","line":347,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 348: c.helpCommandGroupID = groupID","file":"command.go","line":348,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1309: GroupID: c.helpCommandGroupID,","file":"command.go","line":1309,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1378: if (sub.IsAvailableCommand() || sub == c.helpCommand) && sub.GroupID == \"\" {","file":"command.go","line":1378,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1955: {{.Title}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name \"help\")))}}","file":"command.go","line":1955,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1958: Additional Commands:{{range $cmds}}{{if (and (eq .GroupID \"\") (or .IsAvailableCommand (eq .Name \"help\")))}}","file":"command.go","line":1958,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 2004: if subcmd.GroupID == group.ID && (subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName) {","file":"command.go","line":2004,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 2012: if subcmd.GroupID == \"\" && (subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName) {","file":"command.go","line":2012,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1983: rootCmd.SetHelpCommandGroupID(\"group\")","file":"command_test.go","line":1983,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2002: rootCmd.SetHelpCommandGroupID(\"help\")","file":"command_test.go","line":2002,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2022: rootCmd.SetHelpCommandGroupID(\"help\")","file":"command_test.go","line":2022,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2096: rootCmd.SetHelpCommandGroupID(\"wrong\")","file":"command_test.go","line":2096,"lexical":0.65,"target":false},{"text":"File: site/content/user_guide.md\nLine 610: `SetHelpCommandGroupId()` and `SetCompletionCommandGroupId()` on the root command, respectively.","file":"site/content/user_guide.md","line":610,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Je cherche à comprendre comment est stockée la valeur numérique passée en argument lors des tests de la ligne de commande. Peux-tu me montrer où cette variable est définie et comment elle est utilisée ?","query":"command test flag","file":"command_test.go","symbol":"flagValue","line":773,"lang":"fr","candidates":[{"text":"File: command_test.go\nLine 616: func TestFlagBeforeCommand(t *testing.T) {","file":"command_test.go","line":616,"lexical":0.65,"target":true},{"text":"File: command_test.go\nLine 740: func TestPersistentFlagsOnSameCommand(t *testing.T) {","file":"command_test.go","line":740,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 966: func TestHelpCommandExecutedOnChildWithFlagThatShadowsParentFlag(t *testing.T) {","file":"command_test.go","line":966,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1300: func TestVersionFlagExecutedOnSubcommand(t *testing.T) {","file":"command_test.go","line":1300,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1312: func TestShorthandVersionFlagExecutedOnSubcommand(t *testing.T) {","file":"command_test.go","line":1312,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1869: func TestFlagOnPflagCommandLine(t *testing.T) {","file":"command_test.go","line":1869,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2292: // TestMergeCommandLineToFlags checks,","file":"command_test.go","line":2292,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2296: func TestMergeCommandLineToFlags(t *testing.T) {","file":"command_test.go","line":2296,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2765: func TestHelpflagCommandExecutedWithVersionSet(t *testing.T) {","file":"command_test.go","line":2765,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2779: func TestHelpflagCommandExecutedWithoutVersionSet(t *testing.T) {","file":"command_test.go","line":2779,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2884: // {\"--unknown\", \"--namespace\", \"foo\", \"child\", \"--bar\"}, // FIXME: This test case fails, returning the error `unknown command \"foo\" for \"root\"` instead of the expected error `unknown flag: --unknown`","file":"command_test.go","line":2884,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 196: // Test that sub-command names are not completed if a local non-persistent flag is present","file":"completions_test.go","line":196,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 212: // Test that sub-command names are completed if a local non-persistent flag is present and TraverseChildren is set to true","file":"completions_test.go","line":212,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 234: // Test that sub-command names from a child cmd are completed if a local non-persistent flag is present","file":"completions_test.go","line":234,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 271: // Test that sub-command names are not completed if a local non-persistent short flag is present","file":"completions_test.go","line":271,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 287: // Test that sub-command names are completed with a persistent flag","file":"completions_test.go","line":287,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 304: // Test that sub-command names are completed with a persistent short flag","file":"completions_test.go","line":304,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 928: // Test required flags for sub-commands","file":"completions_test.go","line":928,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2044: func TestFlagCompletionWorksRootCommandAddedAfterFlags(t *testing.T) {","file":"completions_test.go","line":2044,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"フラグセットから非推奨または非表示ではないフラグを取得し、短縮形と長い名前の両方がある場合は両方を表示し、文字列型の場合は値を引用符で囲むようにフォーマットしてマークダウン形式で出力する関数を書いてください。","query":"man print flags","file":"doc/man_docs.go","symbol":"manPrintFlags","line":159,"lang":"ja","candidates":[{"text":"File: doc/man_docs.go\nLine 159: func manPrintFlags(buf io.StringWriter, flags *pflag.FlagSet) {","file":"doc/man_docs.go","line":159,"lexical":0.65,"target":true},{"text":"File: doc/man_docs.go\nLine 191: manPrintFlags(buf, flags)","file":"doc/man_docs.go","line":191,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 197: manPrintFlags(buf, flags)","file":"doc/man_docs.go","line":197,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 149: func TestManPrintFlagsHidesShortDeprecated(t *testing.T) {","file":"doc/man_docs_test.go","line":149,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 155: manPrintFlags(buf, c.Flags())","file":"doc/man_docs_test.go","line":155,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"コマンドの使い方の表示において、親コマンドの最大長に基づいてパディングの値を返している箇所がありますが、親が存在しない場合や親の長さが最小値を下回る場合の条件分岐に誤りがないか確認してください。","query":"usage padding","file":"command.go","symbol":"UsagePadding","line":563,"lang":"ja","candidates":[{"text":"File: command.go\nLine 560: const minUsagePadding = 25","file":"command.go","line":560,"lexical":0.39999999999999997,"target":true},{"text":"File: command.go\nLine 562: // UsagePadding return padding for the usage.","file":"command.go","line":562,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 563: func (c *Command) UsagePadding() int {","file":"command.go","line":563,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 564: if c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen {","file":"command.go","line":564,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 565: return minUsagePadding","file":"command.go","line":565,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"encontra o valor de preenchimento para o caminho do comando","query":"command path padding","file":"command.go","symbol":"minCommandPathPadding","line":570,"lang":"pt","candidates":[{"text":"File: command.go\nLine 570: const minCommandPathPadding = 11","file":"command.go","line":570,"lexical":0.65,"target":true},{"text":"File: command.go\nLine 572: // CommandPathPadding return padding for the command path.","file":"command.go","line":572,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 573: func (c *Command) CommandPathPadding() int {","file":"command.go","line":573,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 574: if c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen {","file":"command.go","line":574,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 575: return minCommandPathPadding","file":"command.go","line":575,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1968: {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}}","file":"command.go","line":1968,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 2031: fmt.Fprintf(w, \"\\n %s %s\", rpad(subcmd.CommandPath(), subcmd.CommandPathPadding()), subcmd.Short)","file":"command.go","line":2031,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Je cherche la logique qui permet de récupérer la fonction de rendu de l'aide. Elle doit remonter la hiérarchie des commandes si la fonction n'est pas définie localement.","query":"help template function","file":"command.go","symbol":"getHelpTemplateFunc","line":505,"lang":"fr","candidates":[{"text":"File: cobra.go\nLine 83: // AddTemplateFunc adds a template function that's available to Usage and Help","file":"cobra.go","line":83,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 503: // getHelpTemplateFunc returns the help template function for the command","file":"command.go","line":503,"lexical":0.44999999999999996,"target":true},{"text":"File: site/content/user_guide.md\nLine 662: Like help, the function and template are overridable through public methods:","file":"site/content/user_guide.md","line":662,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"대소문자 구분 여부 기본 설정값 찾아줘","query":"case insensitive default","file":"cobra.go","symbol":"defaultCaseInsensitive","line":48,"lang":"ko","candidates":[{"text":"File: cobra.go\nLine 48: defaultCaseInsensitive = false","file":"cobra.go","line":48,"lexical":0.44999999999999996,"target":true},{"text":"File: cobra.go\nLine 61: // EnableCaseInsensitive allows case-insensitive commands names. (case sensitive by default)","file":"cobra.go","line":61,"lexical":0.44999999999999996,"target":false},{"text":"File: cobra.go\nLine 62: var EnableCaseInsensitive = defaultCaseInsensitive","file":"cobra.go","line":62,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1568: EnableCaseInsensitive = defaultCaseInsensitive","file":"command_test.go","line":1568,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Ich schreibe gerade Tests für die CLI-Befehle. Kannst du mir zeigen, wo die Hilfsfunktion definiert ist, die prüft, ob ein bestimmter Textabschnitt in einer Ausgabe fehlt?","query":"test omit string","file":"command_test.go","symbol":"checkStringOmits","line":80,"lang":"de","candidates":[{"text":"File: bash_completions_test.go\nLine 27: func checkOmit(t *testing.T, found, unexpected string) {","file":"bash_completions_test.go","line":27,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 80: func checkStringOmits(t *testing.T, got, expected string) {","file":"command_test.go","line":80,"lexical":0.65,"target":true},{"text":"File: doc/cmd_test.go\nLine 101: func checkStringOmits(t *testing.T, got, expected string) {","file":"doc/cmd_test.go","line":101,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Es scheint ein Problem bei der Generierung der Umgebungsvariablen-Namen zu geben. Die Logik zur Umwandlung der Programmnamen in Großbuchstaben und der anschließende Ersatz von Nicht-ASCII-Alphanumerik-Zeichen durch Unterstriche scheint die Formatierung der Konfigurationsschlüssel zu steuern, aber ich muss sicherstellen, dass die Ersetzung korrekt nach der Großbuchstaben-Konvertierung erfolgt, damit das Schema konsistent bleibt.","query":"config environment variable","file":"completions.go","symbol":"configEnvVar","line":1006,"lang":"de","candidates":[{"text":"File: active_help.go\nLine 42: // GetActiveHelpConfig returns the value of the ActiveHelp environment variable","file":"active_help.go","line":42,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 1013: // getEnvConfig returns the value of the configuration environment variable","file":"completions.go","line":1013,"lexical":0.44999999999999996,"target":true},{"text":"File: site/content/active_help.md\nLine 136: **Note 1**: If the `<PROGRAM>_ACTIVE_HELP` environment variable is set to the string \"0\", Cobra will automatically disable all Active Help output (even if some output was specified by the program using the `cobra.AppendActiveHelp(...)` function). Using \"0…","file":"site/content/active_help.md","line":136,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/active_help.md\nLine 138: …e Help for every single program based on Cobra, she can set the environment variable `COBRA_ACTIVE_HELP` to \"0\". In this case `cobra.GetActiveHelpConfig(cmd)` will return \"0\" no matter what the variable `<PROGRAM>_ACTIVE_HELP` is set to.","file":"site/content/active_help.md","line":138,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/active_help.md\nLine 153: …complete` command, if you want to specify different Active Help configurations, you should use the active help environment variable. That variable is named `<PROGRAM>_ACTIVE_HELP` where any non-ASCII-alphanumeric characters are replaced by an `_`. For ex…","file":"site/content/active_help.md","line":153,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"완성 목록에 사용자 안내 문구를 추가하는 함수가 어디 있지?","query":"append completion help","file":"active_help.go","symbol":"AppendActiveHelp","line":38,"lang":"ko","candidates":[{"text":"File: active_help.go\nLine 38: func AppendActiveHelp(compArray []Completion, activeHelpStr string) []Completion {","file":"active_help.go","line":38,"lexical":0.65,"target":true},{"text":"File: site/content/active_help.md\nLine 30: Adding Active Help is done through the use of the `cobra.AppendActiveHelp(...)` function, where the program repeatedly adds Active Help messages to the list of completions. Keep reading for details.","file":"site/content/active_help.md","line":30,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"特定のフラグに対する補完関数を取得するロジックを探して","query":"flag completion function","file":"completions.go","symbol":"GetFlagCompletionFunc","line":186,"lang":"ja","candidates":[{"text":"File: bash_completions.go\nLine 539: for flag := range flagCompletionFunctions {","file":"bash_completions.go","line":539,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 87: // ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion.","file":"command.go","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 37: // Global map of flag completion functions. Make sure to use flagCompletionMutex before you try to read and write from it.","file":"completions.go","line":37,"lexical":0.65,"target":true},{"text":"File: completions.go\nLine 38: var flagCompletionFunctions = map[*pflag.Flag]CompletionFunc{}","file":"completions.go","line":38,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 40: // lock for reading and writing from flagCompletionFunctions","file":"completions.go","line":40,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 150: // It can be used with [Command.RegisterFlagCompletionFunc] and for [Command.ValidArgsFunction].","file":"completions.go","line":150,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 159: // It can be used with [Command.RegisterFlagCompletionFunc] and for [Command.ValidArgsFunction].","file":"completions.go","line":159,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 166: // RegisterFlagCompletionFunc should be called to register a function to provide completion for a flag.","file":"completions.go","line":166,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 178: if _, exists := flagCompletionFunctions[flag]; exists {","file":"completions.go","line":178,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 181: flagCompletionFunctions[flag] = f","file":"completions.go","line":181,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 185: // GetFlagCompletionFunc returns the completion function for the given flag of the command, if available.","file":"completions.go","line":185,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 195: completionFunc, exists := flagCompletionFunctions[flag]","file":"completions.go","line":195,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 415: // in case the program also registered a completion function for this flag.","file":"completions.go","line":415,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 567: // Find the completion function for the flag or command","file":"completions.go","line":567,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 571: completionFn = flagCompletionFunctions[flag]","file":"completions.go","line":571,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3678: desc: \"get flag completion function for command\",","file":"completions_test.go","line":3678,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3686: desc: \"get persistent flag completion function for command\",","file":"completions_test.go","line":3686,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3694: desc: \"get flag completion function for child command\",","file":"completions_test.go","line":3694,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3702: desc: \"get persistent flag completion function for child command\",","file":"completions_test.go","line":3702,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3710: desc: \"cannot get flag completion function for local parent flag\",","file":"completions_test.go","line":3710,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3721: t.Errorf(\"Unexpected result looking for flag completion function\")","file":"completions_test.go","line":3721,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 49: // The bash completion script will call the bash function f for the flag.","file":"shell_completions.go","line":49,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 72: // The bash completion script will call the bash function f for the flag.","file":"shell_completions.go","line":72,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 75: Providing Active Help for flags is done in the same fashion as for nouns, but using the completion function registered for the flag. For example:","file":"site/content/active_help.md","line":75,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/active_help.md\nLine 108: For simplicity, when in `cmd.ValidArgsFunction(...)` or a flag's completion function, the program should read the","file":"site/content/active_help.md","line":108,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/completions/_index.md\nLine 293: As for nouns, Cobra provides a way of defining dynamic completion of flags. To provide a Go function that Cobra will execute when it needs the list of completion choices for a flag, you must register the function using the `command.RegisterFlagCompletionF…","file":"site/content/completions/_index.md","line":293,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 310: When no completion function is registered for a leaf command or for a flag, Cobra will","file":"site/content/completions/_index.md","line":310,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 314: completion function for that command/flag.","file":"site/content/completions/_index.md","line":314,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 353: To limit completions of flag values to file names with certain extensions you can either use the different `MarkFlagFilename()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterFileExt`, like so:","file":"site/content/completions/_index.md","line":353,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 367: To limit completions of flag values to directory names you can either use the `MarkFlagDirname()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterDirs`, like so:","file":"site/content/completions/_index.md","line":367,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 404: Cobra allows you to add descriptions to your own completions. Simply add the description text after each completion, following a `\\t` separator. Cobra provides the helper function `CompletionWithDesc(string, string)` to create a completion with a descript…","file":"site/content/completions/_index.md","line":404,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 518: * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`).","file":"site/content/completions/_index.md","line":518,"lexical":0.55,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"必須フラグの名前補完が行われることを確認するテストを書いて。","query":"required flag completion test","file":"completions_test.go","symbol":"TestRequiredFlagNameCompletionInGo","line":844,"lang":"ja","candidates":[{"text":"File: completions_test.go\nLine 844: func TestRequiredFlagNameCompletionInGo(t *testing.T) {","file":"completions_test.go","line":844,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 1019: // Test that when all required flags are present, normal completion is done","file":"completions_test.go","line":1019,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3157: func TestCompletionForOneRequiredGroupFlags(t *testing.T) {","file":"completions_test.go","line":3157,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Hay que revisar la configuración disponible para personalizar el comportamiento de los comandos de autocompletado de la terminal, ya que necesito controlar si se muestran descripciones o si el comando por defecto debe estar oculto.","query":"shell completion options","file":"completions.go","symbol":"CompletionOptions","line":107,"lang":"es","candidates":[{"text":"File: command.go\nLine 207: // CompletionOptions is a set of options to control the handling of shell completion","file":"command.go","line":207,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 106: // CompletionOptions are the options to control shell completion","file":"completions.go","line":106,"lexical":0.65,"target":true},{"text":"File: completions.go\nLine 123: func (receiver *CompletionOptions) SetDefaultShellCompDirective(directive ShellCompDirective) {","file":"completions.go","line":123,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 495: if cmd.CompletionOptions.DefaultShellCompDirective != nil {","file":"completions.go","line":495,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 496: directive = *cmd.CompletionOptions.DefaultShellCompDirective","file":"completions.go","line":496,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 4023: rootCmd.CompletionOptions.SetDefaultShellCompDirective(ShellCompDirectiveNoFileComp)","file":"completions_test.go","line":4023,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 4029: childCmd2.CompletionOptions.SetDefaultShellCompDirective(ShellCompDirectiveDefault)","file":"completions_test.go","line":4029,"lexical":0.65,"target":false},{"text":"File: site/content/completions/_index.md\nLine 326: cmd.CompletionOptions.SetDefaultShellCompDirective(ShellCompDirectiveNoFileComp)","file":"site/content/completions/_index.md","line":326,"lexical":0.55,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Die Liste der Argumente für den Zeitbefehl wird nicht korrekt für die Testabläufe vorbereitet und scheint die erwarteten Parameter zu verpassen.","query":"command time args","file":"command_test.go","symbol":"timesCmdArgs","line":275,"lang":"de","candidates":[{"text":"File: command_test.go\nLine 286: Run: func(_ *Command, args []string) { timesCmdArgs = args },","file":"command_test.go","line":286,"lexical":0.65,"target":true},{"text":"File: command_test.go\nLine 348: Run: func(_ *Command, args []string) { timesCmdArgs = args },","file":"command_test.go","line":348,"lexical":0.65,"target":false},{"text":"File: site/content/completions/_index.md\nLine 170: …nstead, the list of completions must be determined at execution-time. In a similar fashion as for static completions, you can use the `ValidArgsFunction` field to provide a Go function that Cobra will execute when it needs the list of completion choices fo…","file":"site/content/completions/_index.md","line":170,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Necesito definir una nueva constante de cadena para identificar una anotación específica de Cobra. Esta anotación se usará para marcar opciones que son requeridas solo cuando se establecen otros grupos de argumentos.","query":"cobra required annotation","file":"flag_groups.go","symbol":"requiredAsGroupAnnotation","line":26,"lang":"es","candidates":[{"text":"File: bash_completions.go\nLine 32: BashCompOneRequiredFlag = \"cobra_annotation_bash_completion_one_required_flag\"","file":"bash_completions.go","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups.go\nLine 26: requiredAsGroupAnnotation = \"cobra_annotation_required_if_others_set\"","file":"flag_groups.go","line":26,"lexical":0.44999999999999996,"target":true},{"text":"File: flag_groups.go\nLine 27: oneRequiredAnnotation = \"cobra_annotation_one_required\"","file":"flag_groups.go","line":27,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups.go\nLine 31: // MarkFlagsRequiredTogether marks the given flags with annotations so that Cobra errors","file":"flag_groups.go","line":31,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups.go\nLine 47: // MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors","file":"flag_groups.go","line":47,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Onde está definida a lista de argumentos para o comando filho?","query":"child command args","file":"command_test.go","symbol":"childCmdArgs","line":819,"lang":"pt","candidates":[{"text":"File: active_help_test.go\nLine 98: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":98,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 121: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 145: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":145,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 183: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":183,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 205: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":205,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 283: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":283,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 305: _ = childCmd.RegisterFlagCompletionFunc(flagname, func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":305,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 338: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":338,"lexical":0.44999999999999996,"target":false},{"text":"File: active_help_test.go\nLine 388: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":388,"lexical":0.44999999999999996,"target":false},{"text":"File: args_test.go\nLine 451: childCmd := &Command{Use: \"child\", Args: NoArgs, Run: emptyRun}","file":"args_test.go","line":451,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 454: _, err := executeCommand(rootCmd, \"child\", \"illegal\", \"args\")","file":"args_test.go","line":454,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 468: childCmd := &Command{Use: \"child\", Args: ArbitraryArgs, Run: emptyRun}","file":"args_test.go","line":468,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 471: _, err := executeCommand(rootCmd, \"child\", \"legal\", \"args\")","file":"args_test.go","line":471,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 569: childCmd := &Command{Use: \"child\", Args: nil, Run: emptyRun}","file":"args_test.go","line":569,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 570: grandchildCmd := &Command{Use: \"grandchild\", Args: nil, Run: emptyRun}","file":"args_test.go","line":570,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 119: Run: func(_ *Command, args []string) { child1CmdArgs = args },","file":"command_test.go","line":119,"lexical":0.65,"target":true},{"text":"File: command_test.go\nLine 121: child2Cmd := &Command{Use: \"child2\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":121,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 824: Run: func(_ *Command, args []string) { childCmdArgs = args },","file":"command_test.go","line":824,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2933: child.SetHelpFunc(func(cmd *Command, args []string) {","file":"command_test.go","line":2933,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1838: _ = childCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":1838,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 2007: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2007,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 2025: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2025,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 2055: _ = childCmd.RegisterFlagCompletionFunc(\"string\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":2055,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3663: _ = childCmd.RegisterFlagCompletionFunc(\"childflag\", func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3663,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3842: childCmd.ValidArgsFunction = func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"completions_test.go","line":3842,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3969: desc: \"no child command not passing args\",","file":"completions_test.go","line":3969,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3975: desc: \"with child command not passing args\",","file":"completions_test.go","line":3975,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"必須フラググループの整合性を検証するロジックを実装してください。指定されたフラググループの少なくとも1つのフラグが設定されている場合、グループ内のすべてのフラグが設定されている必要があります。設定されていないフラグが一部だけ存在する場合、エラーを返すようにしてください。","query":"validate flag groups","file":"flag_groups.go","symbol":"validateRequiredFlagGroups","line":144,"lang":"ja","candidates":[{"text":"File: command.go\nLine 1010: if err := c.ValidateFlagGroups(); err != nil {","file":"command.go","line":1010,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups.go\nLine 79: // ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the","file":"flag_groups.go","line":79,"lexical":0.65,"target":true},{"text":"File: flag_groups.go\nLine 81: func (c *Command) ValidateFlagGroups() error {","file":"flag_groups.go","line":81,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 99: if err := validateRequiredFlagGroups(groupStatus); err != nil {","file":"flag_groups.go","line":99,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 102: if err := validateOneRequiredFlagGroups(oneRequiredGroupStatus); err != nil {","file":"flag_groups.go","line":102,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 105: if err := validateExclusiveFlagGroups(mutuallyExclusiveGroupStatus); err != nil {","file":"flag_groups.go","line":105,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 144: func validateRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":144,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 167: func validateOneRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":167,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 188: func validateExclusiveFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":188,"lexical":0.65,"target":false},{"text":"File: flag_groups_test.go\nLine 22: func TestValidateFlagGroups(t *testing.T) {","file":"flag_groups_test.go","line":22,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"최종 실행 대상 커맨드 객체는 어디에 저장되나요?","query":"final command","file":"completions.go","symbol":"finalCmd","line":325,"lang":"ko","candidates":[{"text":"File: cobra.go\nLine 103: // OnFinalize sets the passed functions to be run when each command's","file":"cobra.go","line":103,"lexical":0.39999999999999997,"target":false},{"text":"File: completions.go\nLine 325: var finalCmd *Command","file":"completions.go","line":325,"lexical":0.39999999999999997,"target":true},{"text":"File: completions.go\nLine 461: // We cannot use finalCmd.Flags() because we may not have called ParsedFlags() for commands","file":"completions.go","line":461,"lexical":0.39999999999999997,"target":false},{"text":"File: completions.go\nLine 520: for _, subCmd := range finalCmd.Commands() {","file":"completions.go","line":520,"lexical":0.39999999999999997,"target":false},{"text":"File: completions.go\nLine 521: if subCmd.IsAvailableCommand() || subCmd == finalCmd.helpCommand {","file":"completions.go","line":521,"lexical":0.39999999999999997,"target":false},{"text":"File: completions.go\nLine 632: func completeRequireFlags(finalCmd *Command, toComplete string) []Completion {","file":"completions.go","line":632,"lexical":0.39999999999999997,"target":false},{"text":"File: completions.go\nLine 644: // We cannot use finalCmd.Flags() because we may not have called ParsedFlags() for commands","file":"completions.go","line":644,"lexical":0.39999999999999997,"target":false},{"text":"File: completions.go\nLine 657: func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg string) (*pflag.Flag, []string, string, error) {","file":"completions.go","line":657,"lexical":0.39999999999999997,"target":false},{"text":"File: completions.go\nLine 727: return nil, args, orgLastArg, &flagCompError{subCommand: finalCmd.Name(), flagName: flagName}","file":"completions.go","line":727,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"임의의 인자를 전달했을 때 명령어가 성공적으로 실행되는지 검증하는 테스트 찾아줘","query":"test arbitrary args","file":"args_test.go","symbol":"TestArbitraryArgs","line":195,"lang":"ko","candidates":[{"text":"File: args_test.go\nLine 195: func TestArbitraryArgs(t *testing.T) {","file":"args_test.go","line":195,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 201: func TestArbitraryArgs_WithValid(t *testing.T) {","file":"args_test.go","line":201,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 207: func TestArbitraryArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":207,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 213: func TestArbitraryArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":213,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"查找验证禁用标志解析后自动补全功能的测试用例","query":"disable flag parsing completion","file":"completions_test.go","symbol":"TestCompleteWithDisableFlagParsing","line":2787,"lang":"zh","candidates":[{"text":"File: completions.go\nLine 435: // Note that we want to perform flagname completion even if finalCmd.DisableFlagParsing==true;","file":"completions.go","line":435,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 436: // doing this allows for completion of persistent flag names even for commands that disable flag parsing.","file":"completions.go","line":436,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3546: desc: \"no completion for --help/-h and --version/-v flags when DisableFlagParsing=true\",","file":"completions_test.go","line":3546,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 3554: desc: \"completions for program-defined --help/-h and --version/-v flags even when DisableFlagParsing=true\",","file":"completions_test.go","line":3554,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Estoy intentando permitir que los usuarios personalicen cómo se muestra la versión en la salida. ¿Dónde puedo configurar el formato de la plantilla para que el sistema lo procese?","query":"set version template","file":"command.go","symbol":"SetVersionTemplate","line":367,"lang":"es","candidates":[{"text":"File: command.go\nLine 366: // SetVersionTemplate sets version template to be used. Application can use it to set custom template.","file":"command.go","line":366,"lexical":0.44999999999999996,"target":true},{"text":"File: command.go\nLine 367: func (c *Command) SetVersionTemplate(s string) {","file":"command.go","line":367,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1245: rootCmd.SetVersionTemplate(`customized version: {{.Version}}`)","file":"command_test.go","line":1245,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1257: rootCmd.SetVersionTemplate(`customized version: {{.Version}}`)","file":"command_test.go","line":1257,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 677: `cmd.SetVersionTemplate(s string)` function.","file":"site/content/user_guide.md","line":677,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 679: Note that templates specified with `SetVersionTemplate` are evaluated using","file":"site/content/user_guide.md","line":679,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Il y a un problème dans la validation des tests : l'assertion qui vérifie si une chaîne de caractères contient une sous-chaîne spécifique n'affiche pas de message d'erreur si la condition n'est pas remplie.","query":"test contains string","file":"doc/cmd_test.go","symbol":"checkStringContains","line":95,"lang":"fr","candidates":[{"text":"File: command_test.go\nLine 74: func checkStringContains(t *testing.T, got, expected string) {","file":"command_test.go","line":74,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2048: checkStringContains(t, output, \"\\nTest group\\n cmd\")","file":"command_test.go","line":2048,"lexical":0.65,"target":false},{"text":"File: doc/cmd_test.go\nLine 95: func checkStringContains(t *testing.T, got, expected string) {","file":"doc/cmd_test.go","line":95,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"cobra","task":"我想看看处理重复参数时的测试逻辑。帮我找一下那个当命令中包含有效参数但同时存在重复参数时,验证报错是否正确的单元测试。","query":"test duplicate args","file":"args_test.go","symbol":"TestNoDuplicateArgs_WithValidOnly_WithInvalidArgs","line":187,"lang":"zh","candidates":[{"text":"File: args_test.go\nLine 110: func noDuplicateArgsWithDuplicate(err error, t *testing.T, arg string) {","file":"args_test.go","line":110,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 169: func TestNoDuplicateArgs(t *testing.T) {","file":"args_test.go","line":169,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 175: func TestNoDuplicateArgs_WithDuplicateArgs(t *testing.T) {","file":"args_test.go","line":175,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 181: func TestNoDuplicateArgs_WithValid_WithDuplicateArgs(t *testing.T) {","file":"args_test.go","line":181,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 187: func TestNoDuplicateArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":187,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"コマンドが2つの引数しか受け付けない設定になっている場合に、3つの引数(a, b, c)を渡すとエラーになることを確認するテストケース。","query":"maximum args error","file":"args_test.go","symbol":"TestMaximumNArgs_WithMoreArgs","line":295,"lang":"ja","candidates":[{"text":"File: args.go\nLine 96: // MaximumNArgs returns an error if there are more than N args.","file":"args.go","line":96,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 77: func maximumNArgsWithMoreArgs(err error, t *testing.T) {","file":"args_test.go","line":77,"lexical":0.65,"target":true},{"text":"File: site/content/user_guide.md\nLine 445: - `MaximumNArgs(int)` - report an error if more than N positional args are provided.","file":"site/content/user_guide.md","line":445,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"유효한 인자만 허용할 때 잘못된 인자가 들어오는 경우의 테스트 코드 찾아줘","query":"test invalid args","file":"args_test.go","symbol":"TestExactArgs_WithValidOnly_WithInvalidArgs","line":339,"lang":"ko","candidates":[{"text":"File: args_test.go\nLine 44: func validOnlyWithInvalidArgs(err error, t *testing.T) {","file":"args_test.go","line":44,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 88: func exactArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":88,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 141: func TestNoArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":141,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 147: func TestNoArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":147,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 161: func TestOnlyValidArgs_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":161,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 187: func TestNoDuplicateArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":187,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 207: func TestArbitraryArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":207,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 213: func TestArbitraryArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":213,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 233: func TestMinimumNArgs_WithValid__WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":233,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 239: func TestMinimumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":239,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 257: func TestMinimumNArgs_WithLessArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":257,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 263: func TestMinimumNArgs_WithLessArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":263,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 283: func TestMaximumNArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":283,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 289: func TestMaximumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":289,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 307: func TestMaximumNArgs_WithMoreArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":307,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 313: func TestMaximumNArgs_WithMoreArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":313,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 333: func TestExactArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":333,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 339: func TestExactArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":339,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 345: func TestExactArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":345,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 351: func TestExactArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":351,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 357: func TestExactArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":357,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 363: func TestExactArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":363,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 383: func TestRangeArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":383,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 389: func TestRangeArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":389,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 395: func TestRangeArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":395,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 401: func TestRangeArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":401,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 407: func TestRangeArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":407,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 413: func TestRangeArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":413,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 533: func TestExactValidArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":533,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 539: func TestExactValidArgs_WithInvalidCount_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":539,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 545: func TestExactValidArgs_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":545,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"帮我找一下测试命令参数验证失败时返回错误指令的那个单元测试。","query":"Test valid args error","file":"completions_test.go","symbol":"TestValidArgsFuncSingleCmdInvalidArg","line":1357,"lang":"zh","candidates":[{"text":"File: args_test.go\nLine 44: func validOnlyWithInvalidArgs(err error, t *testing.T) {","file":"args_test.go","line":44,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 88: func exactArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":88,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"encontra a função que encapsula a execução de um comando com argumentos e retorna o resultado ou erro","query":"execute command args","file":"command_test.go","symbol":"executeCommand","line":32,"lang":"pt","candidates":[{"text":"File: args_test.go\nLine 426: _, err := executeCommand(rootCmd, \"illegal\", \"args\")","file":"args_test.go","line":426,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 443: _, err := executeCommand(rootCmd, \"legal\", \"args\")","file":"args_test.go","line":443,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 454: _, err := executeCommand(rootCmd, \"child\", \"illegal\", \"args\")","file":"args_test.go","line":454,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 471: _, err := executeCommand(rootCmd, \"child\", \"legal\", \"args\")","file":"args_test.go","line":471,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 514: _, err := executeCommand(rootCmd, tc.args...)","file":"args_test.go","line":514,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 32: func executeCommand(root *Command, args ...string) (output string, err error) {","file":"command_test.go","line":32,"lexical":0.65,"target":true},{"text":"File: command_test.go\nLine 33: _, output, err = executeCommandC(root, args...)","file":"command_test.go","line":33,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 37: func executeCommandWithContext(ctx context.Context, root *Command, args ...string) (output string, err error) {","file":"command_test.go","line":37,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 48: func executeCommandC(root *Command, args ...string) (c *Command, output string, err error) {","file":"command_test.go","line":48,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 59: func executeCommandWithContextC(ctx context.Context, root *Command, args ...string) (c *Command, output string, err error) {","file":"command_test.go","line":59,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 727: output, err := executeCommand(c, args...)","file":"command_test.go","line":727,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1556: output, err := executeCommand(rootCmd, test.args...)","file":"command_test.go","line":1556,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3146: output, err := executeCommand(c, args...)","file":"completions_test.go","line":3146,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3244: output, err := executeCommand(c, args...)","file":"completions_test.go","line":3244,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3338: output, err := executeCommand(c, args...)","file":"completions_test.go","line":3338,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3572: output, err := executeCommand(c, args...)","file":"completions_test.go","line":3572,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3636: output, err := executeCommand(&root, args...)","file":"completions_test.go","line":3636,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 4060: output, err := executeCommand(rootCmd, args...)","file":"completions_test.go","line":4060,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/completions/_index.md\nLine 170: …imilar fashion as for static completions, you can use the `ValidArgsFunction` field to provide a Go function that Cobra will execute when it needs the list of completion choices for the nouns of a command. Note that either `ValidArgs` or `ValidArgsFunctio…","file":"site/content/completions/_index.md","line":170,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Der Wert für die Unterbefehl-Option wird nicht korrekt an die Testumgebung übergeben oder bleibt in einem undefinierten Zustand.","query":"child flag value","file":"command_test.go","symbol":"childFlagValue","line":829,"lang":"de","candidates":[{"text":"File: command_test.go\nLine 568: childCmd.Flags().IntVarP(&intFlagValue, \"intf\", \"i\", -1, \"\")","file":"command_test.go","line":568,"lexical":0.44999999999999996,"target":true},{"text":"File: command_test.go\nLine 590: childCmd.Flags().IntVarP(&intFlagValue, \"intf\", \"i\", -1, \"\")","file":"command_test.go","line":590,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 622: childCmd.Flags().IntVarP(&flagValue, \"intf\", \"i\", -1, \"\")","file":"command_test.go","line":622,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 829: var childFlagValue int","file":"command_test.go","line":829,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 831: childCmd.Flags().IntVarP(&childFlagValue, \"childf\", \"c\", -1, \"\")","file":"command_test.go","line":831,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 848: if childFlagValue != 7 {","file":"command_test.go","line":848,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 849: t.Errorf(\"childFlagValue expected: %v, got %v\", 7, childFlagValue)","file":"command_test.go","line":849,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Necesito saber el nombre exacto que se usa para registrar el comando de ayuda en el sistema de comandos.","query":"command help name","file":"command.go","symbol":"helpCommandName","line":38,"lang":"es","candidates":[{"text":"File: active_help.go\nLine 43: // <PROGRAM>_ACTIVE_HELP where <PROGRAM> is the name of the root command in upper","file":"active_help.go","line":43,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 38: helpCommandName = \"help\"","file":"command.go","line":38,"lexical":0.65,"target":true},{"text":"File: command.go\nLine 1273: Simply type ` + c.DisplayName() + ` help [path to command] for full details.`,","file":"command.go","line":1273,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1472: // DisplayName returns the name to display in help text. Returns command Name()","file":"command.go","line":1472,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1952: Available Commands:{{range $cmds}}{{if (or .IsAvailableCommand (eq .Name \"help\"))}}","file":"command.go","line":1952,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1955: {{.Title}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name \"help\")))}}","file":"command.go","line":1955,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1958: Additional Commands:{{range $cmds}}{{if (and (eq .GroupID \"\") (or .IsAvailableCommand (eq .Name \"help\")))}}","file":"command.go","line":1958,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 1996: if subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName {","file":"command.go","line":1996,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 2004: if subcmd.GroupID == group.ID && (subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName) {","file":"command.go","line":2004,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 2012: if subcmd.GroupID == \"\" && (subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName) {","file":"command.go","line":2012,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1007: Simply type ` + c.Name() + ` help [path to command] for full details.`,","file":"command_test.go","line":1007,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 515: // Complete subcommand names, including the help command","file":"completions.go","line":515,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 765: if cmd.Name() != ShellCompRequestCmd && cmd.Name() != helpCommandName {","file":"completions.go","line":765,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/active_help.md\nLine 153: When debugging with the `__complete` command, if you want to specify different Active Help configurations, you should use the active help environment variable. That variable is named `<PROGRAM>_ACTIVE_HELP` where any non-ASCII-alphanumeric characters are …","file":"site/content/active_help.md","line":153,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"How can I create a manual page from a CLI command using the documentation generator?","query":"gen man header","file":"doc/man_examples_test.go","symbol":"ExampleGenManTree","line":25,"lang":"en","candidates":[{"text":"File: doc/man_docs.go\nLine 38: func GenManTree(cmd *cobra.Command, header *GenManHeader, dir string) error {","file":"doc/man_docs.go","line":38,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 51: header = &GenManHeader{}","file":"doc/man_docs.go","line":51,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 79: return GenMan(cmd, &headerCopy, f)","file":"doc/man_docs.go","line":79,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 85: Header *GenManHeader","file":"doc/man_docs.go","line":85,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 90: // GenManHeader is a lot like the .TH header at the start of man pages. These","file":"doc/man_docs.go","line":90,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 94: type GenManHeader struct {","file":"doc/man_docs.go","line":94,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 105: func GenMan(cmd *cobra.Command, header *GenManHeader, w io.Writer) error {","file":"doc/man_docs.go","line":105,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 107: header = &GenManHeader{}","file":"doc/man_docs.go","line":107,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 109: if err := fillHeader(header, cmd.CommandPath(), cmd.DisableAutoGenTag); err != nil {","file":"doc/man_docs.go","line":109,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 113: b := genMan(cmd, header)","file":"doc/man_docs.go","line":113,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 118: func fillHeader(header *GenManHeader, name string, disableAutoGen bool) error {","file":"doc/man_docs.go","line":118,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 143: func manPreamble(buf io.StringWriter, header *GenManHeader, cmd *cobra.Command, dashedName string) {","file":"doc/man_docs.go","line":143,"lexical":0.65,"target":false},{"text":"File: doc/man_docs.go\nLine 202: func genMan(cmd *cobra.Command, header *GenManHeader) []byte {","file":"doc/man_docs.go","line":202,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 40: header := &GenManHeader{","file":"doc/man_docs_test.go","line":40,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 47: if err := GenMan(echoCmd, header, buf); err != nil {","file":"doc/man_docs_test.go","line":47,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 70: header := &GenManHeader{","file":"doc/man_docs_test.go","line":70,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 82: if err := GenMan(echoCmd, header, buf); err != nil {","file":"doc/man_docs_test.go","line":82,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 109: header := &GenManHeader{","file":"doc/man_docs_test.go","line":109,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 116: if err := GenMan(echoCmd, header, buf); err != nil {","file":"doc/man_docs_test.go","line":116,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 135: header := &GenManHeader{}","file":"doc/man_docs_test.go","line":135,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 136: if err := GenMan(rootCmd, header, buf); err != nil {","file":"doc/man_docs_test.go","line":136,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 166: header := &GenManHeader{Section: \"2\"}","file":"doc/man_docs_test.go","line":166,"lexical":0.65,"target":false},{"text":"File: doc/man_docs_test.go\nLine 173: if err := GenManTree(c, header, tmpdir); err != nil {","file":"doc/man_docs_test.go","line":173,"lexical":0.65,"target":false},{"text":"File: doc/man_examples_test.go\nLine 30: header := &doc.GenManHeader{","file":"doc/man_examples_test.go","line":30,"lexical":0.65,"target":true},{"text":"File: doc/man_examples_test.go\nLine 34: cobra.CheckErr(doc.GenManTree(cmd, header, \"/tmp\"))","file":"doc/man_examples_test.go","line":34,"lexical":0.65,"target":false},{"text":"File: doc/man_examples_test.go\nLine 42: header := &doc.GenManHeader{","file":"doc/man_examples_test.go","line":42,"lexical":0.65,"target":false},{"text":"File: doc/man_examples_test.go\nLine 47: cobra.CheckErr(doc.GenMan(cmd, header, out))","file":"doc/man_examples_test.go","line":47,"lexical":0.65,"target":false},{"text":"File: site/content/docgen/man.md\nLine 20: header := &doc.GenManHeader{","file":"site/content/docgen/man.md","line":20,"lexical":0.65,"target":false},{"text":"File: site/content/docgen/man.md\nLine 24: err := doc.GenManTree(cmd, header, \"/tmp\")","file":"site/content/docgen/man.md","line":24,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"I'm working on the fuzzy matching logic for the command parser. Can you find the helper that calculates the edit distance between two strings, including an option to treat them as case-insensitive?","query":"levenshtein distance","file":"cobra.go","symbol":"ld","line":192,"lang":"en","candidates":[{"text":"File: cobra.go\nLine 191: // ld compares two strings and returns the levenshtein distance between them.","file":"cobra.go","line":191,"lexical":0.39999999999999997,"target":true},{"text":"File: cobra_test.go\nLine 49: func TestLevenshteinDistance(t *testing.T) {","file":"cobra_test.go","line":49,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 253: // DisableSuggestions disables the suggestions based on Levenshtein distance","file":"command.go","line":253,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 257: // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions.","file":"command.go","line":257,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 867: levenshteinDistance := ld(typedName, cmd.Name(), true)","file":"command.go","line":867,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 868: suggestByLevenshtein := levenshteinDistance <= c.SuggestionsMinimumDistance","file":"command.go","line":868,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 791: …ted based on existing subcommands and use an implementation of [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance). Every registered command that matches a minimum distance of 2 (ignoring case) will be displayed as a suggestion.","file":"site/content/user_guide.md","line":791,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Wo wird die Funktion definiert, die Befehlsinstanzen und String-Argumente verarbeitet?","query":"func cmd args error","file":"args.go","symbol":"PositionalArgs","line":22,"lang":"de","candidates":[{"text":"File: args.go\nLine 22: type PositionalArgs func(cmd *Command, args []string) error","file":"args.go","line":22,"lexical":0.65,"target":true},{"text":"File: args.go\nLine 28: func legacyArgs(cmd *Command, args []string) error {","file":"args.go","line":28,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 42: func NoArgs(cmd *Command, args []string) error {","file":"args.go","line":42,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 51: func OnlyValidArgs(cmd *Command, args []string) error {","file":"args.go","line":51,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 69: func NoDuplicateArgs(cmd *Command, args []string) error {","file":"args.go","line":69,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 82: func ArbitraryArgs(cmd *Command, args []string) error {","file":"args.go","line":82,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 88: return func(cmd *Command, args []string) error {","file":"args.go","line":88,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 98: return func(cmd *Command, args []string) error {","file":"args.go","line":98,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 108: return func(cmd *Command, args []string) error {","file":"args.go","line":108,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 118: return func(cmd *Command, args []string) error {","file":"args.go","line":118,"lexical":0.65,"target":false},{"text":"File: args.go\nLine 128: return func(cmd *Command, args []string) error {","file":"args.go","line":128,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 482: func(cmd *Command, args []string) error {","file":"args_test.go","line":482,"lexical":0.65,"target":false},{"text":"File: command.go\nLine 130: PersistentPreRunE func(cmd *Command, args []string) error","file":"command.go","line":130,"lexical":0.5,"target":false},{"text":"File: command.go\nLine 134: PreRunE func(cmd *Command, args []string) error","file":"command.go","line":134,"lexical":0.5,"target":false},{"text":"File: command.go\nLine 138: RunE func(cmd *Command, args []string) error","file":"command.go","line":138,"lexical":0.5,"target":false},{"text":"File: command.go\nLine 142: PostRunE func(cmd *Command, args []string) error","file":"command.go","line":142,"lexical":0.5,"target":false},{"text":"File: command.go\nLine 146: PersistentPostRunE func(cmd *Command, args []string) error","file":"command.go","line":146,"lexical":0.5,"target":false},{"text":"File: completions.go\nLine 657: func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg string) (*pflag.Flag, []string, string, error) {","file":"completions.go","line":657,"lexical":0.5,"target":false},{"text":"File: completions.go\nLine 831: RunE: func(cmd *Command, args []string) error {","file":"completions.go","line":831,"lexical":0.5,"target":false},{"text":"File: completions.go\nLine 867: RunE: func(cmd *Command, args []string) error {","file":"completions.go","line":867,"lexical":0.5,"target":false},{"text":"File: completions.go\nLine 895: RunE: func(cmd *Command, args []string) error {","file":"completions.go","line":895,"lexical":0.5,"target":false},{"text":"File: completions.go\nLine 917: RunE: func(cmd *Command, args []string) error {","file":"completions.go","line":917,"lexical":0.5,"target":false},{"text":"File: site/content/active_help.md\nLine 41: RunE: func(cmd *cobra.Command, args []string) error {","file":"site/content/active_help.md","line":41,"lexical":0.5,"target":false},{"text":"File: site/content/user_guide.md\nLine 238: RunE: func(cmd *cobra.Command, args []string) error {","file":"site/content/user_guide.md","line":238,"lexical":0.5,"target":false},{"text":"File: site/content/user_guide.md\nLine 469: It is possible to set any custom validator that satisfies `func(cmd *cobra.Command, args []string) error`.","file":"site/content/user_guide.md","line":469,"lexical":0.5,"target":false},{"text":"File: site/content/user_guide.md\nLine 475: Args: func(cmd *cobra.Command, args []string) error {","file":"site/content/user_guide.md","line":475,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Ich arbeite gerade an der Implementierung der CLI-Parameter. Kannst du mir zeigen, welches Typ-Definition verwendet wird, um festzulegen, welche Fehler beim Parsen der Flags ignoriert werden sollen?","query":"ignore flag parse errors","file":"command.go","symbol":"FParseErrWhitelist","line":42,"lang":"de","candidates":[{"text":"File: command.go\nLine 41: // FParseErrWhitelist configures Flag parse errors to be ignored","file":"command.go","line":41,"lexical":0.5,"target":true},{"text":"File: command.go\nLine 204: // FParseErrWhitelist flag parse errors to be ignored","file":"command.go","line":204,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"查找验证带描述信息的命令行参数补全测试的逻辑","query":"flag completion test","file":"completions_test.go","symbol":"TestFlagNameCompletionInGoWithDesc","line":583,"lang":"zh","candidates":[{"text":"File: bash_completions.go\nLine 463: WriteStringAndCheck(buf, fmt.Sprintf(\" flags_with_completion+=(%q)\\n\", name))","file":"bash_completions.go","line":463,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 471: WriteStringAndCheck(buf, fmt.Sprintf(\" flags_completion+=(%q)\\n\", ext))","file":"bash_completions.go","line":471,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 473: WriteStringAndCheck(buf, fmt.Sprintf(\" flags_with_completion+=(%q)\\n\", name))","file":"bash_completions.go","line":473,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 477: WriteStringAndCheck(buf, fmt.Sprintf(\" flags_completion+=(%q)\\n\", handlers))","file":"bash_completions.go","line":477,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 479: WriteStringAndCheck(buf, \" flags_completion+=(:)\\n\")","file":"bash_completions.go","line":479,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 482: WriteStringAndCheck(buf, fmt.Sprintf(\" flags_with_completion+=(%q)\\n\", name))","file":"bash_completions.go","line":482,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 490: WriteStringAndCheck(buf, fmt.Sprintf(\" flags_completion+=(%q)\\n\", ext))","file":"bash_completions.go","line":490,"lexical":0.65,"target":false},{"text":"File: bash_completions_test.go\nLine 229: func TestBashCompletionHiddenFlag(t *testing.T) {","file":"bash_completions_test.go","line":229,"lexical":0.65,"target":false},{"text":"File: bash_completions_test.go\nLine 245: func TestBashCompletionDeprecatedFlag(t *testing.T) {","file":"bash_completions_test.go","line":245,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 493: func TestFlagNameCompletionInGo(t *testing.T) {","file":"completions_test.go","line":493,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 583: func TestFlagNameCompletionInGoWithDesc(t *testing.T) {","file":"completions_test.go","line":583,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 697: func TestFlagNameCompletionRepeat(t *testing.T) {","file":"completions_test.go","line":697,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 844: func TestRequiredFlagNameCompletionInGo(t *testing.T) {","file":"completions_test.go","line":844,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1019: // Test that when all required flags are present, normal completion is done","file":"completions_test.go","line":1019,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1038: func TestFlagFileExtFilterCompletionInGo(t *testing.T) {","file":"completions_test.go","line":1038,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1160: func TestFlagDirFilterCompletionInGo(t *testing.T) {","file":"completions_test.go","line":1160,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1624: func TestFlagCompletionInGo(t *testing.T) {","file":"completions_test.go","line":1624,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1821: func TestFlagCompletionWithNotInterspersedArgs(t *testing.T) {","file":"completions_test.go","line":1821,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1842: // Test flag completion with no argument","file":"completions_test.go","line":1842,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2044: func TestFlagCompletionWorksRootCommandAddedAfterFlags(t *testing.T) {","file":"completions_test.go","line":2044,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2063: // Test that flag completion works for the subcmd","file":"completions_test.go","line":2063,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2079: func TestFlagCompletionForPersistentFlagsCalledFromSubCmd(t *testing.T) {","file":"completions_test.go","line":2079,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2096: // Test that persistent flag completion works for the subcmd","file":"completions_test.go","line":2096,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2112: // This test tries to register flag completion concurrently to make sure the","file":"completions_test.go","line":2112,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2121: func TestFlagCompletionConcurrentRegistration(t *testing.T) {","file":"completions_test.go","line":2121,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2160: // Test that flag completion works for each flag","file":"completions_test.go","line":2160,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2187: func TestFlagCompletionInGoWithDesc(t *testing.T) {","file":"completions_test.go","line":2187,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2694: func TestMultipleShorthandFlagCompletion(t *testing.T) {","file":"completions_test.go","line":2694,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3057: func TestCompletionForGroupedFlags(t *testing.T) {","file":"completions_test.go","line":3057,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3157: func TestCompletionForOneRequiredGroupFlags(t *testing.T) {","file":"completions_test.go","line":3157,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3255: func TestCompletionForMutuallyExclusiveFlags(t *testing.T) {","file":"completions_test.go","line":3255,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 3349: func TestCompletionCobraFlags(t *testing.T) {","file":"completions_test.go","line":3349,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"检查字符串是否包含预期子串","query":"string contains check","file":"command_test.go","symbol":"checkStringContains","line":74,"lang":"zh","candidates":[{"text":"File: command_test.go\nLine 74: func checkStringContains(t *testing.T, got, expected string) {","file":"command_test.go","line":74,"lexical":0.44999999999999996,"target":true},{"text":"File: command_test.go\nLine 388: checkStringContains(t, cmdHelp, \"kubectl plugin [flags]\")","file":"command_test.go","line":388,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 389: checkStringContains(t, cmdHelp, \"help for kubectl plugin\")","file":"command_test.go","line":389,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 390: checkStringContains(t, cmdHelp, \"version for kubectl plugin\")","file":"command_test.go","line":390,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 412: checkStringContains(t, rootHelp, \"kubectl plugin [command]\")","file":"command_test.go","line":412,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 413: checkStringContains(t, rootHelp, \"help for kubectl plugin\")","file":"command_test.go","line":413,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 414: checkStringContains(t, rootHelp, \"version for kubectl plugin\")","file":"command_test.go","line":414,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 415: checkStringContains(t, rootHelp, \"kubectl plugin [command] --help\")","file":"command_test.go","line":415,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 422: checkStringContains(t, childHelp, \"kubectl plugin sub [flags]\")","file":"command_test.go","line":422,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 423: checkStringContains(t, childHelp, \"help for sub\")","file":"command_test.go","line":423,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 430: checkStringContains(t, helpHelp, \"kubectl plugin help [path to command]\")","file":"command_test.go","line":430,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 431: checkStringContains(t, helpHelp, \"kubectl plugin help [command]\")","file":"command_test.go","line":431,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 597: checkStringContains(t, err.Error(), \"unknown shorthand\")","file":"command_test.go","line":597,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 613: checkStringContains(t, err.Error(), \"invalid syntax\")","file":"command_test.go","line":613,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 950: checkStringContains(t, output, rootCmd.Long)","file":"command_test.go","line":950,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 963: checkStringContains(t, output, childCmd.Long)","file":"command_test.go","line":963,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1072: checkStringContains(t, output, rootCmd.Long)","file":"command_test.go","line":1072,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1085: checkStringContains(t, output, childCmd.Long)","file":"command_test.go","line":1085,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1103: checkStringContains(t, output, \"[flags]\")","file":"command_test.go","line":1103,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1113: checkStringContains(t, output, \"[flags]\")","file":"command_test.go","line":1113,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1126: checkStringContains(t, output, childCmd.Long)","file":"command_test.go","line":1126,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1143: checkStringContains(t, got, expected)","file":"command_test.go","line":1143,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1153: checkStringContains(t, got, expected)","file":"command_test.go","line":1153,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1176: checkStringContains(t, output, \"root version 1.0.0\")","file":"command_test.go","line":1176,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1194: checkStringContains(t, output, \"kubectl plugin version 1.0.0\")","file":"command_test.go","line":1194,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1205: checkStringContains(t, output, \"version 1.0.0\")","file":"command_test.go","line":1205,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1216: checkStringContains(t, output, \"-v, --version\")","file":"command_test.go","line":1216,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1229: checkStringContains(t, output, \"--version\")","file":"command_test.go","line":1229,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1240: checkStringContains(t, output, \"root version 1.0.0\")","file":"command_test.go","line":1240,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1252: checkStringContains(t, output, \"customized version: 1.0.0\")","file":"command_test.go","line":1252,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1264: checkStringContains(t, output, \"customized version: 1.0.0\")","file":"command_test.go","line":1264,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1277: checkStringContains(t, output, \"root error prefix: unknown flag: --unknown-flag\")","file":"command_test.go","line":1277,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"trouve la fonction qui lance une commande en capturant la sortie dans un buffer avec un contexte","query":"execute command context output","file":"command_test.go","symbol":"executeCommandWithContextC","line":59,"lang":"fr","candidates":[{"text":"File: command_test.go\nLine 37: func executeCommandWithContext(ctx context.Context, root *Command, args ...string) (output string, err error) {","file":"command_test.go","line":37,"lexical":0.65,"target":true},{"text":"File: command_test.go\nLine 59: func executeCommandWithContextC(ctx context.Context, root *Command, args ...string) (c *Command, output string, err error) {","file":"command_test.go","line":59,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 2948: output, err := executeCommandWithContext(executionCtx, rootCmd, \"help\", \"child\")","file":"command_test.go","line":2948,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1304: _, output, err := executeCommandWithContextC(ctx, rootCmd, ShellCompNoDescRequestCmd, \"childCmd\", \"\")","file":"completions_test.go","line":1304,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"명령줄 인자로 유효한 값 2개('a', 'b')를 전달할 때, MinimumNArgs 검증기가 에러 없이 성공적으로 실행되는지 확인하는 버그 리포트","query":"MinimumNArgs valid args test","file":"args_test.go","symbol":"TestMinimumNArgs_WithValid__WithInvalidArgs","line":233,"lang":"ko","candidates":[{"text":"File: args_test.go\nLine 227: func TestMinimumNArgs_WithValid(t *testing.T) {","file":"args_test.go","line":227,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 233: func TestMinimumNArgs_WithValid__WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":233,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 239: func TestMinimumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":239,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 251: func TestMinimumNArgs_WithLessArgs_WithValid(t *testing.T) {","file":"args_test.go","line":251,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 257: func TestMinimumNArgs_WithLessArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":257,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 263: func TestMinimumNArgs_WithLessArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":263,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"特定のフラグに対して、シェル補完時にディレクトリ名のみが表示されるように制限する処理が正しく動作していない可能性があります。フラグのオプション名を指定して補完対象をディレクトリに限定するメソッドを確認してください。","query":"shell completion directory","file":"shell_completions.go","symbol":"MarkFlagDirname","line":83,"lang":"ja","candidates":[{"text":"File: site/content/completions/_index.md\nLine 367: To limit completions of flag values to directory names you can either use the `MarkFlagDirname()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterDirs`, like so:","file":"site/content/completions/_index.md","line":367,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 379: To limit completions of flag values to directory names *within another directory* you can use a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterDirs` like so:","file":"site/content/completions/_index.md","line":379,"lexical":0.55,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"我想看看在测试重复参数报错时,是怎么校验错误信息的格式的。帮我找一下那个专门用来验证参数冲突错误字符串的辅助函数。","query":"duplicate argument error","file":"args_test.go","symbol":"noDuplicateArgsWithDuplicate","line":110,"lang":"zh","candidates":[{"text":"File: args.go\nLine 73: return fmt.Errorf(\"duplicate argument %q for %q\", arg, cmd.CommandPath())","file":"args.go","line":73,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/user_guide.md\nLine 450: - `NoDuplicateArgs` - report an error if any positional argument value is provided more than once.","file":"site/content/user_guide.md","line":450,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"설정값들을 검증하는 로직을 구현 중인데, 특정 플래그 세트에 전달된 이름들이 모두 존재하는지 확인하는 함수가 어디에 있는지 알려줘. 루프를 돌면서 하나라도 없으면 false를 반환하는 방식이면 좋겠어.","query":"check all flags","file":"flag_groups.go","symbol":"hasAllFlags","line":111,"lang":"ko","candidates":[{"text":"File: command.go\nLine 1810: // HasLocalFlags checks if the command has flags specifically declared locally.","file":"command.go","line":1810,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 1831: // HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden","file":"command.go","line":1831,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"trouver la liste des arguments de la commande racine","query":"root command args","file":"command_test.go","symbol":"rootCmdArgs","line":89,"lang":"fr","candidates":[{"text":"File: active_help_test.go\nLine 240: _ = rootCmd.RegisterFlagCompletionFunc(flagname, func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) {","file":"active_help_test.go","line":240,"lexical":0.44999999999999996,"target":false},{"text":"File: args_test.go\nLine 426: _, err := executeCommand(rootCmd, \"illegal\", \"args\")","file":"args_test.go","line":426,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 439: rootCmd := &Command{Use: \"root\", Args: ArbitraryArgs, Run: emptyRun}","file":"args_test.go","line":439,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 443: _, err := executeCommand(rootCmd, \"legal\", \"args\")","file":"args_test.go","line":443,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 454: _, err := executeCommand(rootCmd, \"child\", \"illegal\", \"args\")","file":"args_test.go","line":454,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 471: _, err := executeCommand(rootCmd, \"child\", \"legal\", \"args\")","file":"args_test.go","line":471,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 510: rootCmd := &Command{Use: \"root\", Args: pargs, Run: emptyRun}","file":"args_test.go","line":510,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 514: _, err := executeCommand(rootCmd, tc.args...)","file":"args_test.go","line":514,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 556: rootCmd := &Command{Use: \"root\", Args: nil, Run: emptyRun}","file":"args_test.go","line":556,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 568: rootCmd := &Command{Use: \"root\", Args: nil, Run: emptyRun}","file":"args_test.go","line":568,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 32: func executeCommand(root *Command, args ...string) (output string, err error) {","file":"command_test.go","line":32,"lexical":0.65,"target":true},{"text":"File: command_test.go\nLine 33: _, output, err = executeCommandC(root, args...)","file":"command_test.go","line":33,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 37: func executeCommandWithContext(ctx context.Context, root *Command, args ...string) (output string, err error) {","file":"command_test.go","line":37,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 48: func executeCommandC(root *Command, args ...string) (c *Command, output string, err error) {","file":"command_test.go","line":48,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 59: func executeCommandWithContextC(ctx context.Context, root *Command, args ...string) (c *Command, output string, err error) {","file":"command_test.go","line":59,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 93: Run: func(_ *Command, args []string) { rootCmdArgs = args },","file":"command_test.go","line":93,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 115: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":115,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 139: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":139,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 276: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":276,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 309: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":309,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 338: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":338,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 439: rootCmd := &Command{Use: \"foo\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":439,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 467: rootCmd := &Command{Use: \"foo\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":467,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 745: Run: func(_ *Command, args []string) { rootCmdArgs = args },","file":"command_test.go","line":745,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1107: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: func(*Command, []string) {}}","file":"command_test.go","line":1107,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1556: output, err := executeCommand(rootCmd, test.args...)","file":"command_test.go","line":1556,"lexical":0.65,"target":false},{"text":"File: command_test.go\nLine 1586: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"command_test.go","line":1586,"lexical":0.65,"target":false},{"text":"File: completions.go\nLine 333: // For Root commands that don't specify any value for their Args fields, when we call","file":"completions.go","line":333,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 1385: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"completions_test.go","line":1385,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 1489: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"completions_test.go","line":1489,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 1545: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"completions_test.go","line":1545,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 1561: rootCmd := &Command{Use: \"root\", Args: NoArgs, Run: emptyRun}","file":"completions_test.go","line":1561,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"¿Donde se define la clave de anotación para las opciones mutuamente excluyentes en cobra?","query":"cobra annotation mutually exclusive","file":"flag_groups.go","symbol":"mutuallyExclusiveAnnotation","line":28,"lang":"es","candidates":[{"text":"File: flag_groups.go\nLine 28: mutuallyExclusiveAnnotation = \"cobra_annotation_mutually_exclusive\"","file":"flag_groups.go","line":28,"lexical":0.5,"target":true},{"text":"File: flag_groups.go\nLine 63: // MarkFlagsMutuallyExclusive marks the given flags with annotations so that Cobra errors","file":"flag_groups.go","line":63,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"查找根据命令名称和全局环境变量获取帮助配置的逻辑","query":"active help env","file":"active_help.go","symbol":"GetActiveHelpConfig","line":47,"lang":"zh","candidates":[{"text":"File: active_help.go\nLine 26: activeHelpEnvVarSuffix = \"ACTIVE_HELP\"","file":"active_help.go","line":26,"lexical":0.65,"target":true},{"text":"File: active_help.go\nLine 27: activeHelpGlobalEnvVar = configEnvVarGlobalPrefix + \"_\" + activeHelpEnvVarSuffix","file":"active_help.go","line":27,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 42: // GetActiveHelpConfig returns the value of the ActiveHelp environment variable","file":"active_help.go","line":42,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 45: // It will always return \"0\" if the global environment variable COBRA_ACTIVE_HELP","file":"active_help.go","line":45,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 48: activeHelpCfg := os.Getenv(activeHelpGlobalEnvVar)","file":"active_help.go","line":48,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 50: activeHelpCfg = os.Getenv(activeHelpEnvVar(cmd.Root().Name()))","file":"active_help.go","line":50,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 55: // activeHelpEnvVar returns the name of the program-specific ActiveHelp environment","file":"active_help.go","line":55,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 58: func activeHelpEnvVar(name string) string {","file":"active_help.go","line":58,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 59: return configEnvVar(name, activeHelpEnvVarSuffix)","file":"active_help.go","line":59,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 281: os.Setenv(activeHelpEnvVar(rootCmd.Name()), activeHelpCfg)","file":"active_help_test.go","line":281,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 299: os.Setenv(activeHelpEnvVar(rootCmd.Name()), activeHelpCfg)","file":"active_help_test.go","line":299,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 336: os.Setenv(activeHelpEnvVar(rootCmd.Name()), \"0\")","file":"active_help_test.go","line":336,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 348: os.Unsetenv(activeHelpEnvVar(rootCmd.Name()))","file":"active_help_test.go","line":348,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 361: os.Setenv(activeHelpGlobalEnvVar, \"0\")","file":"active_help_test.go","line":361,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 364: os.Setenv(activeHelpEnvVar(rootCmd.Name()), \"1\")","file":"active_help_test.go","line":364,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 383: os.Setenv(activeHelpGlobalEnvVar, \"on\")","file":"active_help_test.go","line":383,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 386: os.Setenv(activeHelpEnvVar(rootCmd.Name()), activeHelpCfg)","file":"active_help_test.go","line":386,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 401: ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, activeHelpEnvVar(name)))","file":"bash_completions.go","line":401,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completionsV2_test.go\nLine 31: activeHelpVar := activeHelpEnvVar(c.Name())","file":"bash_completionsV2_test.go","line":31,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completions_test.go\nLine 287: activeHelpVar := activeHelpEnvVar(c.Name())","file":"bash_completions_test.go","line":287,"lexical":0.44999999999999996,"target":false},{"text":"File: fish_completions.go\nLine 272: ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))","file":"fish_completions.go","line":272,"lexical":0.44999999999999996,"target":false},{"text":"File: fish_completions_test.go\nLine 97: activeHelpVar := activeHelpEnvVar(c.Name())","file":"fish_completions_test.go","line":97,"lexical":0.44999999999999996,"target":false},{"text":"File: powershell_completions.go\nLine 310: ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))","file":"powershell_completions.go","line":310,"lexical":0.44999999999999996,"target":false},{"text":"File: powershell_completions_test.go\nLine 31: activeHelpVar := activeHelpEnvVar(c.Name())","file":"powershell_completions_test.go","line":31,"lexical":0.44999999999999996,"target":false},{"text":"File: powershell_completions_test.go\nLine 32: check(t, output, fmt.Sprintf(\"${env:%s}=0\", activeHelpVar))","file":"powershell_completions_test.go","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/active_help.md\nLine 100: The way to configure Active Help is to use the program's Active Help environment","file":"site/content/active_help.md","line":100,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 136: **Note 1**: If the `<PROGRAM>_ACTIVE_HELP` environment variable is set to the string \"0\", Cobra will automatically disable all Active Help output (even if some output was specified by the program using the `cobra.AppendActiveHelp(...)` function). Using \"0…","file":"site/content/active_help.md","line":136,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 138: **Note 2**: If a user wants to disable Active Help for every single program based on Cobra, she can set the environment variable `COBRA_ACTIVE_HELP` to \"0\". In this case `cobra.GetActiveHelpConfig(cmd)` will return \"0\" no matter what the variable `<PROGRA…","file":"site/content/active_help.md","line":138,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 153: …with the `__complete` command, if you want to specify different Active Help configurations, you should use the active help environment variable. That variable is named `<PROGRAM>_ACTIVE_HELP` where any non-ASCII-alphanumeric characters are replaced by an …","file":"site/content/active_help.md","line":153,"lexical":0.65,"target":false},{"text":"File: zsh_completions_test.go\nLine 31: activeHelpVar := activeHelpEnvVar(c.Name())","file":"zsh_completions_test.go","line":31,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Estoy revisando cómo se comporta el sistema cuando se pasan argumentos inválidos a un comando que solo debería aceptar valores válidos. ¿Podrías mostrarme la prueba que verifica que falle correctamente al recibir una mezcla de inputs válidos e inválidos bajo una configuración de rango específica?","query":"test invalid args","file":"args_test.go","symbol":"TestRangeArgs_WithValidOnly_WithInvalidArgs","line":389,"lang":"es","candidates":[{"text":"File: args_test.go\nLine 44: func validOnlyWithInvalidArgs(err error, t *testing.T) {","file":"args_test.go","line":44,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 88: func exactArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":88,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 141: func TestNoArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":141,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 147: func TestNoArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":147,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 161: func TestOnlyValidArgs_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":161,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 187: func TestNoDuplicateArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":187,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 207: func TestArbitraryArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":207,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 213: func TestArbitraryArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":213,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 233: func TestMinimumNArgs_WithValid__WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":233,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 239: func TestMinimumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":239,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 257: func TestMinimumNArgs_WithLessArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":257,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 263: func TestMinimumNArgs_WithLessArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":263,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 283: func TestMaximumNArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":283,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 289: func TestMaximumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":289,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 307: func TestMaximumNArgs_WithMoreArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":307,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 313: func TestMaximumNArgs_WithMoreArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":313,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 333: func TestExactArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":333,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 339: func TestExactArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":339,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 345: func TestExactArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":345,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 351: func TestExactArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":351,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 357: func TestExactArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":357,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 363: func TestExactArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":363,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 383: func TestRangeArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":383,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 389: func TestRangeArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":389,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 395: func TestRangeArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":395,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 401: func TestRangeArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":401,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 407: func TestRangeArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":407,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 413: func TestRangeArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":413,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 533: func TestExactValidArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":533,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 539: func TestExactValidArgs_WithInvalidCount_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":539,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 545: func TestExactValidArgs_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":545,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"I need to check if we have a command to run the static analysis tools. Is there a way to trigger the linter through the build system?","query":"lint run","file":"Makefile","symbol":"lint","line":18,"lang":"en","candidates":[{"text":"File: Makefile\nLine 5: $(warning \"could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh\")","file":"Makefile","line":5,"lexical":0.39999999999999997,"target":true},{"text":"File: Makefile\nLine 19: $(info ******************** running lint tools ********************)","file":"Makefile","line":19,"lexical":0.39999999999999997,"target":false},{"text":"File: Makefile\nLine 20: golangci-lint run -v","file":"Makefile","line":20,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/projects_using_cobra.md\nLine 24: - [Golangci-lint](https://golangci-lint.run)","file":"site/content/projects_using_cobra.md","line":24,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"인자가 없는 명령어를 실행할 때 잘못된 인자를 넣으면 어떻게 처리되는지 테스트하는 부분 좀 찾아줘","query":"no args invalid","file":"args_test.go","symbol":"TestNoArgs_WithValid_WithInvalidArgs","line":141,"lang":"ko","candidates":[{"text":"File: args_test.go\nLine 141: func TestNoArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":141,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 147: func TestNoArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":147,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 187: func TestNoDuplicateArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":187,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"ArbitraryArgs 테스트에서 유효한 인자를 전달했을 때 정상 실행되는지 확인하는 테스트 케이스를 찾아줘.","query":"TestArbitraryArgs WithValid","file":"args_test.go","symbol":"TestArbitraryArgs_WithValid","line":201,"lang":"ko","candidates":[{"text":"File: args_test.go\nLine 201: func TestArbitraryArgs_WithValid(t *testing.T) {","file":"args_test.go","line":201,"lexical":0.39999999999999997,"target":true},{"text":"File: args_test.go\nLine 207: func TestArbitraryArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":207,"lexical":0.39999999999999997,"target":false},{"text":"File: args_test.go\nLine 213: func TestArbitraryArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":213,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"인자 개수 제한 검증 테스트 찾아줘","query":"max args test","file":"args_test.go","symbol":"TestMaximumNArgs_WithValid_WithInvalidArgs","line":283,"lang":"ko","candidates":[{"text":"File: args_test.go\nLine 77: func maximumNArgsWithMoreArgs(err error, t *testing.T) {","file":"args_test.go","line":77,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 271: func TestMaximumNArgs(t *testing.T) {","file":"args_test.go","line":271,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 277: func TestMaximumNArgs_WithValid(t *testing.T) {","file":"args_test.go","line":277,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 283: func TestMaximumNArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":283,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 289: func TestMaximumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":289,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 295: func TestMaximumNArgs_WithMoreArgs(t *testing.T) {","file":"args_test.go","line":295,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 301: func TestMaximumNArgs_WithMoreArgs_WithValid(t *testing.T) {","file":"args_test.go","line":301,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 307: func TestMaximumNArgs_WithMoreArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":307,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 313: func TestMaximumNArgs_WithMoreArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":313,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"셸 완성 시 결과 뒤에 공백을 추가하지 않도록 설정하는 상수가 어디에 정의되어 있나요?","query":"shell completion no space","file":"completions.go","symbol":"ShellCompDirectiveNoSpace","line":62,"lang":"ko","candidates":[{"text":"File: completions_test.go\nLine 1647: return completions, ShellCompDirectiveNoSpace | ShellCompDirectiveNoFileComp","file":"completions_test.go","line":1647,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1694: \"Completion ended with directive: ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp\", \"\"}, \"\\n\")","file":"completions_test.go","line":1694,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1710: \"Completion ended with directive: ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp\", \"\"}, \"\\n\")","file":"completions_test.go","line":1710,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2210: return completions, ShellCompDirectiveNoSpace | ShellCompDirectiveNoFileComp","file":"completions_test.go","line":2210,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2257: \"Completion ended with directive: ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp\", \"\"}, \"\\n\")","file":"completions_test.go","line":2257,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2273: \"Completion ended with directive: ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp\", \"\"}, \"\\n\")","file":"completions_test.go","line":2273,"lexical":0.65,"target":false},{"text":"File: site/content/completions/_index.md\nLine 196: You may have noticed the use of `cobra.ShellCompDirective`. These directives are bit fields allowing to control some shell completion behaviors for your particular completion. You can combine them with the bit-or operator such as `cobra.ShellCompDirectiv…","file":"site/content/completions/_index.md","line":196,"lexical":0.6000000000000001,"target":false},{"text":"File: site/content/completions/_index.md\nLine 205: // Indicates that the shell should not add a space after the completion,","file":"site/content/completions/_index.md","line":205,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"查找调用自定义帮助函数来展示命令说明的方法","query":"help command function","file":"command.go","symbol":"Help","line":520,"lang":"zh","candidates":[{"text":"File: command.go\nLine 482: // HelpFunc returns either the function set by SetHelpFunc for this command","file":"command.go","line":482,"lexical":0.65,"target":true},{"text":"File: command.go\nLine 503: // getHelpTemplateFunc returns the help template function for the command","file":"command.go","line":503,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 34: Adding Active Help when completing a noun is done within the `ValidArgsFunction(...)` of a command. Please notice the use of `cobra.AppendActiveHelp(...)` in the following example:","file":"site/content/active_help.md","line":34,"lexical":0.65,"target":false},{"text":"File: site/content/completions/bash.md\nLine 64: The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__kubectl_custom_func()` (`__<command-use>_custom_func()`) to be called when the built in processor was unable to find a solution. In the case …","file":"site/content/completions/bash.md","line":64,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"不正な引数で有効な引数のみが許可される範囲チェックのテストを実行する","query":"range args test invalid","file":"args_test.go","symbol":"TestRangeArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs","line":413,"lang":"ja","candidates":[{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 383: func TestRangeArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":383,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 389: func TestRangeArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":389,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 395: func TestRangeArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":395,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 401: func TestRangeArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":401,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 407: func TestRangeArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":407,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 413: func TestRangeArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":413,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"コマンドのフラグエラー処理を委譲する関数を取得するロジックはどうなってる?","query":"flag error func","file":"command.go","symbol":"FlagErrorFunc","line":547,"lang":"ja","candidates":[{"text":"File: command.go\nLine 175: // flagErrorFunc is func defined by user and it's called when the parsing of","file":"command.go","line":175,"lexical":0.44999999999999996,"target":true},{"text":"File: command.go\nLine 177: flagErrorFunc func(*Command, error) error","file":"command.go","line":177,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 326: // SetFlagErrorFunc sets a function to generate an error when flag parsing","file":"command.go","line":326,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 328: func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) {","file":"command.go","line":328,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 329: c.flagErrorFunc = f","file":"command.go","line":329,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 544: // FlagErrorFunc returns either the function set by SetFlagErrorFunc for this","file":"command.go","line":544,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 547: func (c *Command) FlagErrorFunc() (f func(*Command, error) error) {","file":"command.go","line":547,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 548: if c.flagErrorFunc != nil {","file":"command.go","line":548,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 549: return c.flagErrorFunc","file":"command.go","line":549,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 553: return c.parent.FlagErrorFunc()","file":"command.go","line":553,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 921: return c.FlagErrorFunc()(c, err)","file":"command.go","line":921,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 1180: func (c *Command) ValidateRequiredFlags() error {","file":"command.go","line":1180,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 1868: func (c *Command) ParseFlags(args []string) error {","file":"command.go","line":1868,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1818: t.Error(\"Normalization function should be passed on to Local flag set\")","file":"command_test.go","line":1818,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1841: t.Error(\"Normalization function should be passed on to inherited flag set in command added before flag\")","file":"command_test.go","line":1841,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 1846: t.Error(\"Normalization function should be passed on to inherited flag set in command added after flag\")","file":"command_test.go","line":1846,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2218: func TestFlagErrorFunc(t *testing.T) {","file":"command_test.go","line":2218,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2222: c.SetFlagErrorFunc(func(_ *Command, err error) error {","file":"command_test.go","line":2222,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2235: func TestFlagErrorFuncHelp(t *testing.T) {","file":"command_test.go","line":2235,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2238: c.SetFlagErrorFunc(func(_ *Command, err error) error {","file":"command_test.go","line":2238,"lexical":0.44999999999999996,"target":false},{"text":"File: command_test.go\nLine 2882: func TestUnknownFlagShouldReturnSameErrorRegardlessOfArgPosition(t *testing.T) {","file":"command_test.go","line":2882,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 52: func (e *flagCompError) Error() string {","file":"completions.go","line":52,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 170: func (c *Command) RegisterFlagCompletionFunc(flagName string, f CompletionFunc) error {","file":"completions.go","line":170,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 173: return fmt.Errorf(\"RegisterFlagCompletionFunc: flag '%s' does not exist\", flagName)","file":"completions.go","line":173,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 179: return fmt.Errorf(\"RegisterFlagCompletionFunc: flag '%s' already registered\", flagName)","file":"completions.go","line":179,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 657: func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg string) (*pflag.Flag, []string, string, error) {","file":"completions.go","line":657,"lexical":0.44999999999999996,"target":false},{"text":"File: completions_test.go\nLine 3721: t.Errorf(\"Unexpected result looking for flag completion function\")","file":"completions_test.go","line":3721,"lexical":0.44999999999999996,"target":false},{"text":"File: flag_groups.go\nLine 81: func (c *Command) ValidateFlagGroups() error {","file":"flag_groups.go","line":81,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 144: func validateRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":144,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 167: func validateOneRequiredFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":167,"lexical":0.65,"target":false},{"text":"File: flag_groups.go\nLine 188: func validateExclusiveFlagGroups(data map[string]map[string]bool) error {","file":"flag_groups.go","line":188,"lexical":0.65,"target":false},{"text":"File: shell_completions.go\nLine 24: func (c *Command) MarkFlagRequired(name string) error {","file":"shell_completions.go","line":24,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"¿Cómo se verifica que la validación de argumentos rechace entradas no válidas cuando se requiere que no haya argumentos?","query":"test valid args invalid","file":"args_test.go","symbol":"TestNoArgs_WithValidOnly_WithInvalidArgs","line":147,"lang":"es","candidates":[{"text":"File: args_test.go\nLine 44: func validOnlyWithInvalidArgs(err error, t *testing.T) {","file":"args_test.go","line":44,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 88: func exactArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":88,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 99: func rangeArgsWithInvalidCount(err error, t *testing.T) {","file":"args_test.go","line":99,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 141: func TestNoArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":141,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 147: func TestNoArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":147,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 161: func TestOnlyValidArgs_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":161,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 187: func TestNoDuplicateArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":187,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 207: func TestArbitraryArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":207,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 213: func TestArbitraryArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":213,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 233: func TestMinimumNArgs_WithValid__WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":233,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 239: func TestMinimumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":239,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 257: func TestMinimumNArgs_WithLessArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":257,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 263: func TestMinimumNArgs_WithLessArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":263,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 283: func TestMaximumNArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":283,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 289: func TestMaximumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":289,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 307: func TestMaximumNArgs_WithMoreArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":307,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 313: func TestMaximumNArgs_WithMoreArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":313,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 333: func TestExactArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":333,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 339: func TestExactArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":339,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 345: func TestExactArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":345,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 351: func TestExactArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":351,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 357: func TestExactArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":357,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 363: func TestExactArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":363,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 383: func TestRangeArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":383,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 389: func TestRangeArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":389,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 395: func TestRangeArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":395,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 401: func TestRangeArgs_WithInvalidCount_WithValid(t *testing.T) {","file":"args_test.go","line":401,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 407: func TestRangeArgs_WithInvalidCount_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":407,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 413: func TestRangeArgs_WithInvalidCount_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":413,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 533: func TestExactValidArgs_WithInvalidCount(t *testing.T) {","file":"args_test.go","line":533,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 539: func TestExactValidArgs_WithInvalidCount_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":539,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 545: func TestExactValidArgs_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":545,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Ich schreibe gerade die Testabdeckung für die CLI-Logik. Kannst du mir zeigen, wie die Logik getestet wird, die sicherstellt, dass der Befehl für die Autovervollständigung nur unter bestimmten Bedingungen existiert?","query":"completion command test","file":"completions_test.go","symbol":"TestDefaultCompletionCmd","line":2461,"lang":"de","candidates":[{"text":"File: completions_test.go\nLine 1398: // Test completion of first sub-command with empty argument","file":"completions_test.go","line":1398,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 1414: // Test completion of first sub-command with a prefix to complete","file":"completions_test.go","line":1414,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1443: // Test completion of second sub-command with empty argument","file":"completions_test.go","line":1443,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1498: // Test completion of first sub-command with empty argument","file":"completions_test.go","line":1498,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1514: // Test completion of first sub-command with a prefix to complete","file":"completions_test.go","line":1514,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1731: // Test completion of first sub-command with empty argument","file":"completions_test.go","line":1731,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1747: // Test completion of first sub-command with a prefix to complete","file":"completions_test.go","line":1747,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 1776: // Test completion of second sub-command with empty argument","file":"completions_test.go","line":1776,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2044: func TestFlagCompletionWorksRootCommandAddedAfterFlags(t *testing.T) {","file":"completions_test.go","line":2044,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2399: // Test that completion includes the help command","file":"completions_test.go","line":2399,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2452: // Remove completion command for the next test","file":"completions_test.go","line":2452,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2468: // Test that when there are no sub-commands, the completion command is not created if it is not called directly.","file":"completions_test.go","line":2468,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2477: // Test that when there are no sub-commands, the completion command is created when it is called directly.","file":"completions_test.go","line":2477,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2484: // Remove completion command for the next test","file":"completions_test.go","line":2484,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2494: // Test that a completion command is created if there are other sub-commands","file":"completions_test.go","line":2494,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2506: // Remove completion command for the next test","file":"completions_test.go","line":2506,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2509: // Test that the default completion command can be disabled","file":"completions_test.go","line":2509,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2529: // Remove completion command for the next test","file":"completions_test.go","line":2529,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2542: // Remove completion command for the next test","file":"completions_test.go","line":2542,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2556: // Remove completion command for the next test","file":"completions_test.go","line":2556,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2572: // Remove completion command for the next test","file":"completions_test.go","line":2572,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2588: // Remove completion command for the next test","file":"completions_test.go","line":2588,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2591: // Test that the 'completion' command can be hidden","file":"completions_test.go","line":2591,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2603: // Remove completion command for the next test","file":"completions_test.go","line":2603,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2610: // Test that when there are no sub-commands, the 'completion' command is not completed","file":"completions_test.go","line":2610,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2625: // Test that when there are no sub-commands, completion can be triggered for the default","file":"completions_test.go","line":2625,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2651: // Test sub-commands of the completion command","file":"completions_test.go","line":2651,"lexical":0.65,"target":false},{"text":"File: completions_test.go\nLine 2669: // Test there are no completions for the sub-commands of the completion command","file":"completions_test.go","line":2669,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Je travaille sur la gestion des options globales de la CLI. Peux-tu me montrer comment on peut restreindre les suggestions de fichiers pour un drapeau persistant en fonction de certaines extensions ?","query":"persistent flag extensions","file":"shell_completions.go","symbol":"MarkPersistentFlagFilename","line":61,"lang":"fr","candidates":[{"text":"File: shell_completions.go\nLine 61: func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error {","file":"shell_completions.go","line":61,"lexical":0.44999999999999996,"target":true},{"text":"File: shell_completions.go\nLine 62: return MarkFlagFilename(c.PersistentFlags(), name, extensions...)","file":"shell_completions.go","line":62,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Estou tentando validar como as sugestões de preenchimento automático funcionam quando anexamos uma função de ajuda dinâmica ao comando principal. Você pode me mostrar o teste que verifica se essa mensagem de ajuda é gerada corretamente e incluída no output do shell?","query":"active help completion","file":"active_help_test.go","symbol":"TestActiveHelpAlone","line":29,"lang":"pt","candidates":[{"text":"File: active_help.go\nLine 32: // Such strings will be processed by the completion script and will be shown as ActiveHelp","file":"active_help.go","line":32,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 37: // ActiveHelp line will be shown below the previous ones when completion is triggered.","file":"active_help.go","line":37,"lexical":0.65,"target":false},{"text":"File: active_help.go\nLine 38: func AppendActiveHelp(compArray []Completion, activeHelpStr string) []Completion {","file":"active_help.go","line":38,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 97: // Test that activeHelp can be added following other completions","file":"active_help_test.go","line":97,"lexical":0.65,"target":true},{"text":"File: active_help_test.go\nLine 120: // Test that activeHelp can be added preceding other completions","file":"active_help_test.go","line":120,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 144: // Test that activeHelp can be added interleaved with other completions","file":"active_help_test.go","line":144,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 204: // Test that multiple activeHelp messages can be used along with completions","file":"active_help_test.go","line":204,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 90: # Disable ActiveHelp which is not supported for bash completion v1","file":"bash_completions.go","line":90,"lexical":0.65,"target":false},{"text":"File: bash_completionsV2.go\nLine 142: # Separate activeHelp from normal completions","file":"bash_completionsV2.go","line":142,"lexical":0.65,"target":false},{"text":"File: bash_completionsV2.go\nLine 204: # there will be completions presented, so that we know how to handle ActiveHelp.","file":"bash_completionsV2.go","line":204,"lexical":0.65,"target":false},{"text":"File: bash_completionsV2.go\nLine 248: # Separate activeHelp lines from real completions.","file":"bash_completionsV2.go","line":248,"lexical":0.65,"target":false},{"text":"File: bash_completionsV2.go\nLine 249: # Fills the $activeHelp and $completions arrays.","file":"bash_completionsV2.go","line":249,"lexical":0.65,"target":false},{"text":"File: bash_completionsV2.go\nLine 264: # Not an activeHelp line but a normal completion","file":"bash_completionsV2.go","line":264,"lexical":0.65,"target":false},{"text":"File: bash_completionsV2_test.go\nLine 23: func TestBashCompletionV2WithActiveHelp(t *testing.T) {","file":"bash_completionsV2_test.go","line":23,"lexical":0.65,"target":false},{"text":"File: bash_completions_test.go\nLine 279: func TestBashCompletionNoActiveHelp(t *testing.T) {","file":"bash_completions_test.go","line":279,"lexical":0.65,"target":false},{"text":"File: fish_completions_test.go\nLine 89: func TestFishCompletionNoActiveHelp(t *testing.T) {","file":"fish_completions_test.go","line":89,"lexical":0.65,"target":false},{"text":"File: powershell_completions_test.go\nLine 23: func TestPwshCompletionNoActiveHelp(t *testing.T) {","file":"powershell_completions_test.go","line":23,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 3: Active Help is a framework provided by Cobra which allows a program to define messages (hints, warnings, etc) that will be printed during program usage. It aims to make it easier for your users to learn how to use your program. If configured by the progr…","file":"site/content/active_help.md","line":3,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 18: **Hint**: A good place to use Active Help messages is when the normal completion system does not provide any suggestions. In such cases, Active Help nicely supplements the normal shell completions to guide the user in knowing what is expected by the progra…","file":"site/content/active_help.md","line":18,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 23: - Bash (using [bash completion V2](completions/_index.md#bash-completion-v2) only). Note that bash 4.4 or higher is required for the prompt to appear when an Active Help message is printed.","file":"site/content/active_help.md","line":23,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 28: As Active Help uses the shell completion system, the implementation of Active Help messages is done by enhancing custom dynamic completions. If you are not familiar with dynamic completions, please refer to [Shell Completions](completions/_index.md).","file":"site/content/active_help.md","line":28,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 30: Adding Active Help is done through the use of the `cobra.AppendActiveHelp(...)` function, where the program repeatedly adds Active Help messages to the list of completions. Keep reading for details.","file":"site/content/active_help.md","line":30,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 58: The example above defines the completions (none, in this specific example) as well as the Active Help messages for the `helm repo add` command. It yields the following behavior:","file":"site/content/active_help.md","line":58,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 71: **Hint**: As can be seen in the above example, a good place to use Active Help messages is when the normal completion system does not provide any suggestions. In such cases, Active Help nicely supplements the normal shell completions.","file":"site/content/active_help.md","line":71,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 75: Providing Active Help for flags is done in the same fashion as for nouns, but using the completion function registered for the flag. For example:","file":"site/content/active_help.md","line":75,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 142: ## Active Help with Cobra's default completion command","file":"site/content/active_help.md","line":142,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 145: When using the default `completion` command, Active Help is configurable in the same","file":"site/content/active_help.md","line":145,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 151: Debugging your Active Help code is done in the same way as debugging your dynamic completion code, which is with Cobra's hidden `__complete` command. Please refer to [debugging shell completion](completions/_index.md#debugging) for details.","file":"site/content/active_help.md","line":151,"lexical":0.65,"target":false},{"text":"File: site/content/user_guide.md\nLine 831: Cobra makes use of the shell-completion system to define a framework allowing you to provide Active Help to your users.","file":"site/content/user_guide.md","line":831,"lexical":0.44999999999999996,"target":false},{"text":"File: zsh_completions.go\nLine 217: # - there are completions following the activeHelp statements, or","file":"zsh_completions.go","line":217,"lexical":0.65,"target":false},{"text":"File: zsh_completions.go\nLine 218: # - file completion will be performed (so there will be choices after the activeHelp)","file":"zsh_completions.go","line":218,"lexical":0.65,"target":false},{"text":"File: zsh_completions_test.go\nLine 23: func TestZshCompletionWithActiveHelp(t *testing.T) {","file":"zsh_completions_test.go","line":23,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"查找返回版本模板字符串且包含回溯逻辑的实现","query":"version template","file":"command.go","symbol":"VersionTemplate","line":618,"lang":"zh","candidates":[{"text":"File: command.go\nLine 191: // versionTemplate is the version template defined by user.","file":"command.go","line":191,"lexical":0.39999999999999997,"target":true},{"text":"File: command.go\nLine 192: versionTemplate *tmplFunc","file":"command.go","line":192,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 366: // SetVersionTemplate sets version template to be used. Application can use it to set custom template.","file":"command.go","line":366,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 367: func (c *Command) SetVersionTemplate(s string) {","file":"command.go","line":367,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 369: c.versionTemplate = nil","file":"command.go","line":369,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 372: c.versionTemplate = tmpl(s)","file":"command.go","line":372,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 616: // VersionTemplate return version template for the command.","file":"command.go","line":616,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 618: func (c *Command) VersionTemplate() string {","file":"command.go","line":618,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 619: if c.versionTemplate != nil {","file":"command.go","line":619,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 620: return c.versionTemplate.tmpl","file":"command.go","line":620,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 624: return c.parent.VersionTemplate()","file":"command.go","line":624,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 626: return defaultVersionTemplate","file":"command.go","line":626,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 629: // getVersionTemplateFunc returns the version template function for the command","file":"command.go","line":629,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 631: func (c *Command) getVersionTemplateFunc() func(w io.Writer, data interface{}) error {","file":"command.go","line":631,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 632: if c.versionTemplate != nil {","file":"command.go","line":632,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 633: return c.versionTemplate.fn","file":"command.go","line":633,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 637: return c.parent.getVersionTemplateFunc()","file":"command.go","line":637,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 946: fn := c.getVersionTemplateFunc()","file":"command.go","line":946,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 2064: const defaultVersionTemplate = `{{with .DisplayName}}{{printf \"%s \" .}}{{end}}{{printf \"version %s\" .Version}}","file":"command.go","line":2064,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 2067: // defaultVersionFunc is equivalent to executing defaultVersionTemplate. The two should be changed in sync.","file":"command.go","line":2067,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1243: func TestVersionTemplate(t *testing.T) {","file":"command_test.go","line":1243,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1245: rootCmd.SetVersionTemplate(`customized version: {{.Version}}`)","file":"command_test.go","line":1245,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1255: func TestShorthandVersionTemplate(t *testing.T) {","file":"command_test.go","line":1255,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 1257: rootCmd.SetVersionTemplate(`customized version: {{.Version}}`)","file":"command_test.go","line":1257,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 676: the version template. The template can be customized using the","file":"site/content/user_guide.md","line":676,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 677: `cmd.SetVersionTemplate(s string)` function.","file":"site/content/user_guide.md","line":677,"lexical":0.39999999999999997,"target":false},{"text":"File: site/content/user_guide.md\nLine 679: Note that templates specified with `SetVersionTemplate` are evaluated using","file":"site/content/user_guide.md","line":679,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"¿Dónde se define el valor para desactivar globalmente la ayuda activa?","query":"active help disable","file":"active_help.go","symbol":"activeHelpGlobalDisable","line":28,"lang":"es","candidates":[{"text":"File: active_help.go\nLine 28: activeHelpGlobalDisable = \"0\"","file":"active_help.go","line":28,"lexical":0.65,"target":true},{"text":"File: active_help.go\nLine 49: if activeHelpCfg != activeHelpGlobalDisable {","file":"active_help.go","line":49,"lexical":0.65,"target":false},{"text":"File: active_help_test.go\nLine 319: func TestDisableActiveHelp(t *testing.T) {","file":"active_help_test.go","line":319,"lexical":0.65,"target":false},{"text":"File: bash_completions.go\nLine 90: # Disable ActiveHelp which is not supported for bash completion v1","file":"bash_completions.go","line":90,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completionsV2_test.go\nLine 30: // check that active help is not being disabled","file":"bash_completionsV2_test.go","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: bash_completions_test.go\nLine 286: // check that active help is being disabled","file":"bash_completions_test.go","line":286,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 257: noActiveHelp := GetActiveHelpConfig(finalCmd) == activeHelpGlobalDisable","file":"completions.go","line":257,"lexical":0.44999999999999996,"target":false},{"text":"File: completions.go\nLine 261: // Remove all activeHelp entries if it's disabled.","file":"completions.go","line":261,"lexical":0.44999999999999996,"target":false},{"text":"File: fish_completions.go\nLine 55: # Disable ActiveHelp which is not supported for fish shell","file":"fish_completions.go","line":55,"lexical":0.44999999999999996,"target":false},{"text":"File: fish_completions_test.go\nLine 96: // check that active help is being disabled","file":"fish_completions_test.go","line":96,"lexical":0.44999999999999996,"target":false},{"text":"File: powershell_completions.go\nLine 124: # First disable ActiveHelp which is not supported for Powershell","file":"powershell_completions.go","line":124,"lexical":0.44999999999999996,"target":false},{"text":"File: powershell_completions_test.go\nLine 30: // check that active help is being disabled","file":"powershell_completions_test.go","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: site/content/active_help.md\nLine 97: You may want to allow your users to disable Active Help or choose between different levels of Active Help. It is entirely up to the program to define the type of configurability of Active Help that it wants to offer, if any.","file":"site/content/active_help.md","line":97,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 136: **Note 1**: If the `<PROGRAM>_ACTIVE_HELP` environment variable is set to the string \"0\", Cobra will automatically disable all Active Help output (even if some output was specified by the program using the `cobra.AppendActiveHelp(...)` function). Using \"0…","file":"site/content/active_help.md","line":136,"lexical":0.65,"target":false},{"text":"File: site/content/active_help.md\nLine 138: **Note 2**: If a user wants to disable Active Help for every single program based on Cobra, she can set the environment variable `COBRA_ACTIVE_HELP` to \"0\". In this case `cobra.GetActiveHelpConfig(cmd)` will return \"0\" no matter what the variable `<PROGRA…","file":"site/content/active_help.md","line":138,"lexical":0.65,"target":false},{"text":"File: zsh_completions_test.go\nLine 30: // check that active help is not being disabled","file":"zsh_completions_test.go","line":30,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"how to handle shell completion directives in go","query":"shell completion directives","file":"completions.go","symbol":"directive","line":430,"lang":"en","candidates":[{"text":"File: site/content/completions/_index.md\nLine 196: You may have noticed the use of `cobra.ShellCompDirective`. These directives are bit fields allowing to control some shell completion behaviors for your particular completion. You can combine them with the bit-or operator such as `cobra.ShellCompDirectiv…","file":"site/content/completions/_index.md","line":196,"lexical":0.55,"target":false},{"text":"File: site/content/completions/_index.md\nLine 614: * Similarly, the following completion directives are not supported and will be ignored for `powershell`:","file":"site/content/completions/_index.md","line":614,"lexical":0.55,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"tester le cas où moins d'arguments requis sont fournis avec des arguments valides et invalides","query":"test minimum nargs less valid invalid","file":"args_test.go","symbol":"TestMinimumNArgs_WithLessArgs_WithValid_WithInvalidArgs","line":257,"lang":"fr","candidates":[{"text":"File: args_test.go\nLine 257: func TestMinimumNArgs_WithLessArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":257,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 263: func TestMinimumNArgs_WithLessArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":263,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"테스트 실행을 위해 의존성 설치를 먼저 수행하고, 모든 디렉토리에 대해 상세 출력 옵션으로 Go 테스트를 실행하는 빌드 타겟을 찾아줘.","query":"run tests","file":"Makefile","symbol":"test","line":22,"lang":"ko","candidates":[{"text":"File: CONTRIBUTING.md\nLine 34: for the feature. Tests can be run via `go test ./...` or `make test`.","file":"CONTRIBUTING.md","line":34,"lexical":0.39999999999999997,"target":false},{"text":"File: CONTRIBUTING.md\nLine 43: 1. Make changes and run tests (`make test`)","file":"CONTRIBUTING.md","line":43,"lexical":0.39999999999999997,"target":false},{"text":"File: Makefile\nLine 23: $(info ******************** running tests ********************)","file":"Makefile","line":23,"lexical":0.39999999999999997,"target":true},{"text":"File: Makefile\nLine 27: $(info ******************** running tests with kyoh86/richgo ********************)","file":"Makefile","line":27,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 2628: func TestSetContextPreRun(t *testing.T) {","file":"command_test.go","line":2628,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 2654: func TestSetContextPreRunOverwrite(t *testing.T) {","file":"command_test.go","line":2654,"lexical":0.39999999999999997,"target":false},{"text":"File: command_test.go\nLine 2675: func TestSetContextPersistentPreRun(t *testing.T) {","file":"command_test.go","line":2675,"lexical":0.39999999999999997,"target":false},{"text":"File: completions_test.go\nLine 2114: // This was reported as a problem when tests are run concurrently:","file":"completions_test.go","line":2114,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"印刷するためのコマンド定義を探して。","query":"print command","file":"doc/cmd_test.go","symbol":"printCmd","line":84,"lang":"ja","candidates":[{"text":"File: bash_completions.go\nLine 453: WriteStringAndCheck(buf, fmt.Sprintf(\" commands+=(%q)\\n\", c.Name()))","file":"bash_completions.go","line":453,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completions.go\nLine 638: WriteStringAndCheck(buf, fmt.Sprintf(\" command_aliases+=(%q)\\n\", value))","file":"bash_completions.go","line":638,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completions.go\nLine 664: WriteStringAndCheck(buf, fmt.Sprintf(\"_%s_root_command()\\n{\\n\", commandName))","file":"bash_completions.go","line":664,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completions.go\nLine 666: WriteStringAndCheck(buf, fmt.Sprintf(\"_%s()\\n{\\n\", commandName))","file":"bash_completions.go","line":666,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completions.go\nLine 669: WriteStringAndCheck(buf, fmt.Sprintf(\" last_command=%q\\n\", commandName))","file":"bash_completions.go","line":669,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completionsV2.go\nLine 191: __%[1]s_reprint_commandLine","file":"bash_completionsV2.go","line":191,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completionsV2.go\nLine 215: # Re-printing the command-line will automatically be done","file":"bash_completionsV2.go","line":215,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completionsV2.go\nLine 220: # to re-print the command-line since the shell will","file":"bash_completionsV2.go","line":220,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completionsV2.go\nLine 222: __%[1]s_reprint_commandLine","file":"bash_completionsV2.go","line":222,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completionsV2.go\nLine 227: # print the activeHelp message and reprint the command-line since the shell won't.","file":"bash_completionsV2.go","line":227,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completionsV2.go\nLine 231: __%[1]s_reprint_commandLine","file":"bash_completionsV2.go","line":231,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completionsV2.go\nLine 236: __%[1]s_reprint_commandLine() {","file":"bash_completionsV2.go","line":236,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completions_test.go\nLine 131: printCmd := &Command{","file":"bash_completions_test.go","line":131,"lexical":0.39999999999999997,"target":false},{"text":"File: bash_completions_test.go\nLine 164: rootCmd.AddCommand(echoCmd, printCmd, deprecatedCmd, colonCmd)","file":"bash_completions_test.go","line":164,"lexical":0.39999999999999997,"target":false},{"text":"File: command.go\nLine 104: // Deprecated defines, if this command is deprecated and should print this string when used.","file":"command.go","line":104,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 246: // will be printed by generating docs for this command.","file":"command.go","line":246,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 250: // line of a command when printing help or generating docs","file":"command.go","line":250,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 911: c.Printf(\"Command %q is deprecated, %s\\n\", c.Name(), c.Deprecated)","file":"command.go","line":911,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1132: c.PrintErrf(\"Run '%v --help' for usage.\\n\", c.CommandPath())","file":"command.go","line":1132,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1209: panic(fmt.Sprintf(\"group id '%s' is not defined for subcommand '%s'\", sub.GroupID, sub.CommandPath()))","file":"command.go","line":1209,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1435: func (c *Command) Print(i ...interface{}) {","file":"command.go","line":1435,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1440: func (c *Command) Println(i ...interface{}) {","file":"command.go","line":1440,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1445: func (c *Command) Printf(format string, i ...interface{}) {","file":"command.go","line":1445,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1450: func (c *Command) PrintErr(i ...interface{}) {","file":"command.go","line":1450,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1455: func (c *Command) PrintErrln(i ...interface{}) {","file":"command.go","line":1455,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1460: func (c *Command) PrintErrf(format string, i ...interface{}) {","file":"command.go","line":1460,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1981: fmt.Fprintf(w, \"\\n %s [command]\", c.CommandPath())","file":"command.go","line":1981,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 1994: fmt.Fprintf(w, \"\\n\\nAvailable Commands:\")","file":"command.go","line":1994,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 2010: fmt.Fprintf(w, \"\\n\\nAdditional Commands:\")","file":"command.go","line":2010,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 2031: fmt.Fprintf(w, \"\\n %s %s\", rpad(subcmd.CommandPath(), subcmd.CommandPathPadding()), subcmd.Short)","file":"command.go","line":2031,"lexical":0.6000000000000001,"target":false},{"text":"File: command.go\nLine 2036: fmt.Fprintf(w, \"\\n\\nUse \\\"%s [command] --help\\\" for more information about a command.\", c.CommandPath())","file":"command.go","line":2036,"lexical":0.6000000000000001,"target":false},{"text":"File: command_test.go\nLine 1008: Run: func(c *Command, _ []string) { c.Print(expected) },","file":"command_test.go","line":1008,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"모든 플래그와 하위 명령에 적용될 전역 정규화 함수 설정하는 부분 찾아줘","query":"global flag normalization","file":"command.go","symbol":"SetGlobalNormalizationFunc","line":382,"lang":"ko","candidates":[{"text":"File: command.go\nLine 380: // SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands.","file":"command.go","line":380,"lexical":0.44999999999999996,"target":true},{"text":"File: command.go\nLine 382: func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) {","file":"command.go","line":382,"lexical":0.44999999999999996,"target":false},{"text":"File: command.go\nLine 1682: func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName {","file":"command.go","line":1682,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"tarea: al usar la validación 'solo argumentos válidos' combinada con el requisito de un mínimo de 2 argumentos, el sistema debería rechazar la ejecución correctamente si se proporcionan argumentos no válidos, aunque la cantidad sea suficiente. Verificar que el error se genere y proporcione la información adecuada.","query":"valid only invalid args min","file":"args_test.go","symbol":"TestMinimumNArgs_WithValidOnly_WithInvalidArgs","line":239,"lang":"es","candidates":[{"text":"File: args_test.go\nLine 239: func TestMinimumNArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":239,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 263: func TestMinimumNArgs_WithLessArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":263,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"引数に有効な値と無効な値を入れた時の挙動を確認するテストを見つけて","query":"test arbitrary args","file":"args_test.go","symbol":"TestArbitraryArgs_WithValid_WithInvalidArgs","line":207,"lang":"ja","candidates":[{"text":"File: args_test.go\nLine 195: func TestArbitraryArgs(t *testing.T) {","file":"args_test.go","line":195,"lexical":0.65,"target":true},{"text":"File: args_test.go\nLine 201: func TestArbitraryArgs_WithValid(t *testing.T) {","file":"args_test.go","line":201,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 207: func TestArbitraryArgs_WithValid_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":207,"lexical":0.65,"target":false},{"text":"File: args_test.go\nLine 213: func TestArbitraryArgs_WithValidOnly_WithInvalidArgs(t *testing.T) {","file":"args_test.go","line":213,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"cmdルート名に基づいて各フラグにgoカスタム完了関数を設定する","query":"custom completion annotations","file":"bash_completions.go","symbol":"prepareCustomAnnotationsForFlags","line":536,"lang":"ja","candidates":[{"text":"File: bash_completions.go\nLine 535: // prepareCustomAnnotationsForFlags setup annotations for go completions for registered flags","file":"bash_completions.go","line":535,"lexical":0.65,"target":true},{"text":"File: bash_completions.go\nLine 547: flag.Annotations[BashCompCustom] = []string{fmt.Sprintf(\"__%[1]s_handle_go_custom_completion\", cmd.Root().Name())}","file":"bash_completions.go","line":547,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"cobra","task":"Die Bash-Vervollständigung für Datei-Flags ignoriert leere Erweiterungslisten, unterstützt aber einzelne und mehrere Erweiterungen sowie direkte Annotationen korrekt. Bitte überprüfen, ob die Filterlogik für Dateierweiterungen wie erwartet funktioniert.","query":"go flag completion filter","file":"completions_test.go","symbol":"TestFlagFileExtFilterCompletionInGo","line":1038,"lang":"de","candidates":[{"text":"File: completions_test.go\nLine 1038: func TestFlagFileExtFilterCompletionInGo(t *testing.T) {","file":"completions_test.go","line":1038,"lexical":0.65,"target":true},{"text":"File: completions_test.go\nLine 1160: func TestFlagDirFilterCompletionInGo(t *testing.T) {","file":"completions_test.go","line":1160,"lexical":0.65,"target":false}]} | |