{"record":{"id":"8545fb0a570e8a10","repo":"lima-vm/lima","slug":"option-quiet-can-only-be-used-with-format-tab","errorCode":null,"errorMessage":"option --quiet can only be used with '--format table'","messagePattern":"option --quiet can only be used with '--format table'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/list.go","lineNumber":182,"sourceCode":"\tif listFields && cmd.Flags().Changed(\"format\") {\n\t\treturn errors.New(\"option --list-fields conflicts with option --format\")\n\t}\n\tif len(yq) != 0 {\n\t\tif cmd.Flags().Changed(\"format\") && format != \"json\" && format != \"yaml\" {\n\t\t\treturn errors.New(\"option --yq only works with --format json or yaml\")\n\t\t}\n\t\tif listFields {\n\t\t\treturn errors.New(\"option --list-fields conflicts with option --yq\")\n\t\t}\n\t}\n\tif len(filter) != 0 {\n\t\tif listFields {\n\t\t\treturn errors.New(\"option --list-fields conflicts with option --filter\")\n\t\t}\n\t}\n\n\tif quiet && format != \"table\" {\n\t\treturn errors.New(\"option --quiet can only be used with '--format table'\")\n\t}\n\n\tif listFields {\n\t\tnames := fieldNames()\n\t\tslices.Sort(names)\n\t\tfmt.Fprintln(cmd.OutOrStdout(), strings.Join(names, \"\\n\"))\n\t\treturn nil\n\t}\n\n\tif err := store.Validate(); err != nil {\n\t\tlogrus.Warnf(\"The directory %#q does not look like a valid Lima directory: %v\", store.Directory(), err)\n\t}\n\n\tallInstances, err := store.Instances()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(args) == 0 && len(allInstances) == 0 {","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/list.go#L164-L200","documentation":"--quiet is implemented only for the table format, where it prints just the instance names. With any other format it has no defined behavior, so listAction requires format == \"table\" (the default) when --quiet is set.","triggerScenarios":"Running `limactl list --quiet --format json` (or yaml/custom) — quiet is true and format is not \"table\". Note --quiet with --json also fails because --json sets format to \"json\".","commonSituations":"Scripts that previously used plain `--quiet` later gaining a --format flag for machine output; users expecting --quiet to strip output in every format.","solutions":["Use `--quiet` with the default table format when you only need instance names","For machine-readable output, drop --quiet and use `--format json` (filter fields with --yq if needed)"],"exampleFix":"// before\nlimactl list --quiet --format json\n// after\nlimactl list --format json --yq '.[].name'","handlingStrategy":"validation","validationCode":"args := os.Args[1:]\nif slices.Contains(args, \"--quiet\") && hasNonTableFormat(args) {\n    args = slices.DeleteFunc(args, func(a string) bool { return a == \"--quiet\" })\n}\n\nfunc hasNonTableFormat(args []string) bool {\n    for i, a := range args {\n        if a == \"--format\" && i+1 < len(args) && args[i+1] != \"table\" { return true }\n        if a == \"--json\" { return true } // implies format json\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"if err := runList(); err != nil {\n    if strings.Contains(err.Error(), \"--quiet can only be used with\") { /* retry with --format json and yq */ }\n    return err\n}","preventionTips":["Use --quiet only with the default table format","For scripts, prefer --format json --yq '.[].name' over --quiet","Check flag combinations before composing list commands"],"tags":["cli","flags","lima"],"backgroundTag":"conflicting-cli-flags","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}