{"record":{"id":"60a1df0a4b539a8e","repo":"tinyhumansai/openhuman","slug":"missing-value-for-method","errorCode":null,"errorMessage":"missing value for --method","messagePattern":"missing value for --method","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/cli.rs","lineNumber":466,"sourceCode":"/// Handles the `call` subcommand to invoke a JSON-RPC method directly from the CLI.\n///\n/// This is used for one-off commands and debugging, bypassing the HTTP transport\n/// and calling the internal `invoke_method` directly.\n///\n/// # Arguments\n///\n/// * `args` - Command-line arguments specifying the method and parameters.\nfn run_call_command(args: &[String]) -> Result<()> {\n    let mut method: Option<String> = None;\n    let mut params = \"{}\".to_string();\n\n    let mut i = 0usize;\n    while i < args.len() {\n        match args[i].as_str() {\n            \"--method\" => {\n                method = Some(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow::anyhow!(\"missing value for --method\"))?\n                        .clone(),\n                );\n                i += 2;\n            }\n            \"--params\" => {\n                params = args\n                    .get(i + 1)\n                    .ok_or_else(|| anyhow::anyhow!(\"missing value for --params\"))?\n                    .clone();\n                i += 2;\n            }\n            \"-h\" | \"--help\" => {\n                println!(\"Usage: openhuman call --method <name> [--params '<json>']\");\n                return Ok(());\n            }\n            other => return Err(anyhow::anyhow!(\"unknown call arg: {other}\")),\n        }\n    }","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/cli.rs#L448-L484","documentation":"`openhuman call --method` requires the RPC method name as the next token; the flag was the last argument. The value is consumed unconditionally, so only end-of-args triggers this — a following flag would be taken as the method name and fail later at registry lookup.","triggerScenarios":"`openhuman call --method` as the final token; a script dropping the method half of the pair.","commonSituations":"Building `call` invocations from variables with the method empty/missing; command history editing that deletes the value.","solutions":["Pass the method: `openhuman call --method openhuman.config_get`","Check usage with `openhuman call --help`","If you typed only `--params`, remember `--method` is required (it has no default)"],"exampleFix":"# before\nopenhuman call --method\n# after\nopenhuman call --method openhuman.config_get --params '{}'","handlingStrategy":"validation","validationCode":"# bash: refuse to invoke call without a method\nMETHOD=\"${METHOD:?openhuman call requires --method <rpc-method>}\"\nopenhuman call --method \"$METHOD\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep --method and its value as an adjacent array-element pair","--method is mandatory (no default); --params is the optional one","Verify method names against `openhuman --help` before scripting them"],"tags":["cli","argument-parsing","json-rpc"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}