{"record":{"id":"fc0d2910b434da16","repo":"nikivdev/code","slug":"no-tasks-specified-usage-f-parallel-echo-hello","errorCode":null,"errorMessage":"No tasks specified. Usage: f parallel 'echo hello' 'echo world' or 'label:command'","messagePattern":"No tasks specified\\. Usage: f parallel 'echo hello' 'echo world' or 'label:command'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/parallel.rs","lineNumber":452,"sourceCode":"        .map(|(label, cmd)| Task::new(label, cmd))\n        .collect();\n\n    let runner = Arc::new(ParallelRunner::new(tasks, max_jobs, fail_fast));\n    let exit_code = runner.run().await;\n\n    if exit_code != 0 {\n        std::process::exit(exit_code);\n    }\n\n    Ok(())\n}\n\n/// CLI entry point for `f parallel`.\npub fn run(cmd: crate::cli::ParallelCommand) -> Result<()> {\n    use tokio::runtime::Runtime;\n\n    if cmd.tasks.is_empty() {\n        bail!(\"No tasks specified. Usage: f parallel 'echo hello' 'echo world' or 'label:command'\");\n    }\n\n    // Parse tasks: either \"label:command\" or just \"command\" (auto-labeled)\n    let tasks: Vec<(String, String)> = cmd\n        .tasks\n        .iter()\n        .enumerate()\n        .map(|(i, t)| {\n            if let Some((label, command)) = t.split_once(':') {\n                (label.to_string(), command.to_string())\n            } else {\n                // Auto-generate label from command or use index\n                let label = t\n                    .split_whitespace()\n                    .next()\n                    .unwrap_or(&format!(\"task{}\", i + 1))\n                    .to_string();\n                (label, t.to_string())","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/parallel.rs#L434-L470","documentation":"The `f parallel` CLI entry point checks cmd.tasks before parsing labels. An empty argument list cannot mean anything useful, so it bails with a usage hint embedded in the message.","triggerScenarios":"Running `f parallel` with no quoted task arguments, or `f parallel \"\"` where parsing yields no tasks.","commonSituations":"Shell scripts building the command from an empty array (word-splitting drops all args); forgetting to quote commands containing spaces so the shell mangles them.","solutions":["Pass at least one task: f parallel 'echo hello' 'echo world'.","Use label:command syntax for named tasks: f parallel build:cargo build.","In scripts, guard against empty argument arrays before invoking f parallel."],"exampleFix":"// before\n$ f parallel\n// No tasks specified. Usage: ...\n\n// after\n$ f parallel 'lint:npm run lint' 'test:npm test'","handlingStrategy":"validation","validationCode":"if [ ${#TASKS[@]} -eq 0 ]; then\n  echo \"usage: f parallel 'cmd1' 'label:cmd2'\" >&2\n  exit 1\nfi\nf parallel \"${TASKS[@]}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always quote each task argument so spaces survive shell splitting.","In scripts, build the argument array and bail if it is empty before invoking f parallel.","Use label:command form to keep output attributable to tasks."],"tags":["cli","parallel","usage"],"backgroundTag":"missing-required-argument","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}