{"record":{"id":"5256ea64df0526e1","repo":"jdx/mise","slug":"task-list-options-cannot-be-used-with-task-info","errorCode":null,"errorMessage":"task list options cannot be used with task info","messagePattern":"task list options cannot be used with task info","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/tasks/mod.rs","lineNumber":68,"sourceCode":"        }\n    }\n}\n\nimpl Tasks {\n    pub(crate) async fn run(self) -> Result<()> {\n        let Self { command, task, ls } = self;\n        let cmd = match command {\n            Some(Commands::Ls(cmd)) => Commands::Ls(ls.merge(cmd)?),\n            Some(cmd) => {\n                if ls.has_options() {\n                    bail!(\"task list options cannot be used with subcommands\");\n                }\n                cmd\n            }\n            None => match task {\n                Some(task) => {\n                    if ls.has_non_json_options() {\n                        bail!(\"task list options cannot be used with task info\");\n                    }\n                    Commands::Info(info::TasksInfo {\n                        task,\n                        json: ls.json,\n                    })\n                }\n                None => Commands::Ls(ls),\n            },\n        };\n\n        cmd.run().await\n    }\n}\n","sourceCodeStart":50,"sourceCodeEnd":82,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/tasks/mod.rs#L50-L82","documentation":"`mise tasks` treats a bare task-name argument as an 'info' request. When a task name is given, list-specific options (like --hidden, --no-header, --columns, checked via `ls.has_non_json_options()`) are meaningless and rejected instead of being silently ignored. Only `--json` is forwarded to TasksInfo.","triggerScenarios":"Running `mise tasks <task> --hidden`, `mise tasks <task> --no-header`, or `mise tasks <task> --columns=...` — any non-JSON list option combined with a positional task name.","commonSituations":"Typing a task name to see details but keeping list-display flags from a previous `mise tasks` invocation in the command line; scripting that appends task names to a template command containing list flags.","solutions":["Remove the list options when querying a single task: keep only the task name (and optionally --json)","If you want details as JSON, use `mise tasks <task> --json`","Use `mise tasks` (no task name) if you actually wanted the filtered list view"],"exampleFix":"// before\nmise tasks build --hidden --no-header\n// after\nmise tasks build","handlingStrategy":"validation","validationCode":"const LIST_ONLY_OPTS = ['--hidden','--no-header','--columns'];\nfunction validateTasksCmd(args){\n  const hasTask = args.some(a=>!a.startsWith('-'));\n  const bad = args.filter(a=>LIST_ONLY_OPTS.some(o=>a.startsWith(o)));\n  if (hasTask && bad.length) throw new Error(`list options ${bad.join(' ')} cannot be used with a task name; use --json only`);\n}","typeGuard":"const isListOption = (a: string) => a.startsWith('--') && a !== '--json';\nconst hasListOptions = (args: string[]) => args.some(isListOption);","tryCatchPattern":"try { execSync(`mise tasks ${name} --json`); } catch (e) { if (String(e).includes('task list options')) console.error('drop list flags when querying a single task'); throw e; }","preventionTips":["Reserve list flags for bare `mise tasks` invocations","Use `mise tasks <name> --json` as the canonical single-task query","Keep scripts' flag sets separate for list vs info commands"],"tags":["cli","tasks","mutually-exclusive"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}