{"record":{"id":"d135bbea50f91967","repo":"tinyhumansai/openhuman","slug":"missing-value-for-workspace","errorCode":null,"errorMessage":"missing value for --workspace","messagePattern":"missing value for --workspace","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/core/agent_cli.rs","lineNumber":77,"sourceCode":"fn parse_dump_all_flags(args: &[String]) -> Result<DumpAllFlags> {\n    let mut out: Option<PathBuf> = None;\n    let mut workspace: Option<PathBuf> = None;\n    let mut model: Option<String> = None;\n    let mut verbose = false;\n    let mut i = 0usize;\n    while i < args.len() {\n        match args[i].as_str() {\n            \"--out\" | \"-o\" => {\n                out = Some(PathBuf::from(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow!(\"missing value for --out\"))?,\n                ));\n                i += 2;\n            }\n            \"--workspace\" | \"-w\" => {\n                workspace = Some(PathBuf::from(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow!(\"missing value for --workspace\"))?,\n                ));\n                i += 2;\n            }\n            \"--model\" | \"-m\" => {\n                model = Some(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow!(\"missing value for --model\"))?\n                        .clone(),\n                );\n                i += 2;\n            }\n            \"-v\" | \"--verbose\" => {\n                verbose = true;\n                i += 1;\n            }\n            \"-h\" | \"--help\" => {\n                println!(\"Usage: openhuman agent dump-all --out <dir> [--workspace <path>] [--model <name>] [-v]\");\n                println!();","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/agent_cli.rs#L59-L95","documentation":"Thrown by parse_dump_all_flags when `--workspace`/`-w` is the final token of `openhuman agent dump-all`, so there is no next token to read as the workspace path.","triggerScenarios":"`openhuman agent dump-all --out d -w` or `... --workspace` as the last argument.","commonSituations":"Optional trailing flag appended by a script whose workspace variable is empty or unset, leaving the flag without a value.","solutions":["Either remove the trailing `--workspace` (it is optional) or give it a path.","Guard in scripts: only append the flag when the variable is non-empty (`[ -n \"$WS\" ] && args+=(--workspace \"$WS\")`)."],"exampleFix":"# before\nopenhuman agent dump-all --out ./p --workspace\n\n# after\nopenhuman agent dump-all --out ./p --workspace ~/.openhuman/users/me","handlingStrategy":"validation","validationCode":"# append optional flags only when set\nCMD=(openhuman agent dump-all --out \"$OUT_DIR\")\n[ -n \"${WS:-}\" ] && CMD+=(--workspace \"$WS\")\n\"${CMD[@]}\"","typeGuard":null,"tryCatchPattern":"match run_agent_command(&args) {\n    Err(e) if e.to_string().contains(\"missing value for --workspace\") => {\n        eprintln!(\"--workspace needs a path after it (or omit the flag)\");\n    }\n    other => other?,\n}","preventionTips":["Remember --workspace is optional: omit it rather than leaving it dangling.","Conditionally append optional flags in wrappers only when their variable is non-empty."],"tags":["rust","cli","argument-parsing","missing-value"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}