{"record":{"id":"b60d94a88b830075","repo":"oracle/graal","slug":"the-argument-s-could-not-be-parsed-no-value-wa","errorCode":null,"errorMessage":"The argument '%s' could not be parsed: No value was provided.","messagePattern":"The argument '(.+?)' could not be parsed: No value was provided\\.","errorType":"validation","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/args/ValuedArgument.java","lineNumber":80,"sourceCode":"        set = true;\n        value = defaultValue;\n    }\n\n    /**\n     * Gets the value of the argument.\n     */\n    public T getValue() {\n        return value;\n    }\n\n    @Override\n    public int parse(String[] args, int offsetBase) throws InvalidArgumentException {\n        int offset = offsetBase;\n        if (isOptionArgument()) {\n            if (args[offset].equals(getName())) {\n                ++offset;\n                if (offset >= args.length) {\n                    throw new InvalidArgumentException(getName(), \"No value was provided.\");\n                }\n                value = parseValue(args[offset]);\n            } else {\n                assert args[offset].startsWith(getName() + EQUAL_SIGN);\n                int equalSignIndex = args[offset].indexOf(EQUAL_SIGN);\n                assert equalSignIndex != -1;\n                value = parseValue(args[offset].substring(equalSignIndex + 1));\n            }\n        } else {\n            value = parseValue(args[offset]);\n        }\n        set = true;\n        return offset + 1;\n    }\n\n    /**\n     * Parse the argument value from a string.\n     *","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/args/ValuedArgument.java#L62-L98","documentation":"Thrown by ValuedArgument.parse when an option appears as the very last token in '--name' form: the parser advances past it, sees offset >= args.length, and cannot find the following value token. It is an InvalidArgumentException('No value was provided.') for that argument.","triggerScenarios":"Ending the command line with a value-taking option that has no value: '... --experiment2'. Also when a trailing value was consumed by the shell (unquoted expansion of an empty variable) so the token never reaches Java.","commonSituations":"Truncated command lines (copy-paste cut off), empty environment variables expanding to nothing ('--opt $EMPTY_VAR'), or line-continuation backslashes missing so the value lands on the next line as a separate command.","solutions":["Append the value token after the option ('--experiment2 out2') or use the '--name=value' form, which cannot be split.","Check empty/undefined shell variables used as option values; default them explicitly.","Verify multi-line commands keep the continuation character on every line but the last."],"exampleFix":"# before\nmx profdiff normal-tier --experiment1 out1 --experiment2\n# after\nmx profdiff normal-tier --experiment1 out1 --experiment2 out2","handlingStrategy":"validation","validationCode":"// Prefer '--name=value' form; if using two tokens, verify the value token exists\nif (args[args.length - 1].startsWith(\"--\") && !args[args.length - 1].contains(\"=\")) {\n    throw new IllegalArgumentException(\"Trailing option without value: \" + args[args.length - 1]);\n}","typeGuard":null,"tryCatchPattern":"try {\n    parser.parse(args);\n} catch (InvalidArgumentException e) {\n    if (e.getMessage().contains(\"No value was provided\")) { /* append the missing value token */ }\n}","preventionTips":["Use '--name=value' in scripts so value and option cannot be separated.","Default empty shell variables explicitly: ${VAR:-fallback}."],"tags":["cli","arguments","missing-value","shell"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}