{"record":{"id":"a8b790fbfc2cba54","repo":"nodejs/node","slug":"error-in-command-line-argument-s-n-a8b790","errorCode":null,"errorMessage":"error in command line argument \"%s\"\\n","messagePattern":"error in command line argument \"(.+?)\"\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/gencmn/gencmn.c","lineNumber":62,"sourceCode":"/*7*/ UOPTION_DEF( \"type\", 't', UOPT_REQUIRES_ARG),\n/*8*/ UOPTION_DEF( \"source\", 'S', UOPT_NO_ARG),\n/*9*/ UOPTION_DEF( \"entrypoint\", 'e', UOPT_REQUIRES_ARG),\n/*10*/UOPTION_SOURCEDIR,\n};\n\nextern int\nmain(int argc, char* argv[]) {\n    UBool sourceTOC, verbose;\n    uint32_t maxSize;\n\n    U_MAIN_INIT_ARGS(argc, argv);\n\n    /* preset then read command line options */\n    argc=u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);\n\n    /* error handling, printing usage message */\n    if(argc<0) {\n        fprintf(stderr,\n            \"error in command line argument \\\"%s\\\"\\n\",\n            argv[-argc]);\n    } else if(argc<2) {\n        argc=-1;\n    }\n\n    if(argc<0 || options[0].doesOccur || options[1].doesOccur) {\n        FILE *where = argc < 0 ? stderr : stdout;\n\n        /*\n         * Broken into chucks because the C89 standard says the minimum\n         * required supported string length is 509 bytes.\n         */\n        fprintf(where,\n                \"%csage: %s [ -h, -?, --help ] [ -v, --verbose ] [ -c, --copyright ] [ -C, --comment comment ] [ -d, --destdir dir ] [ -n, --name filename ] [ -t, --type filetype ] [ -S, --source tocfile ] [ -e, --entrypoint name ] maxsize listfile\\n\", argc < 0 ? 'u' : 'U', *argv);\n        if (options[0].doesOccur || options[1].doesOccur) {\n            fprintf(where, \"\\n\"\n                \"Read the list file (default: standard input) and create a common data\\n\"","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/gencmn/gencmn.c#L44-L80","documentation":"gencmn (ICU common-data archive builder) uses u_parseArgs like the other ICU tools. A negative return means an unrecognized or malformed argument; gencmn prints the offending token via argv[-argc] before falling through to the usage banner. This is the generic CLI-parse failure for gencmn.","triggerScenarios":"Passing an unknown flag, a flag missing its required argument, or a malformed option string to gencmn. If fewer than two positional arguments remain after parsing (argc<2), argc is also forced to -1 to trigger usage.","commonSituations":"Wrong argument count (gencmn expects a max-size and a list of files); typo in an option in the ICU packaging Makefile; invoking gencmn manually without the required size/file operands.","solutions":["Run gencmn with no args or -h to read its usage and supply the required max-size and file operands.","Correct the offending token named in the message in your packaging script.","Ensure at least the size argument and one file name are passed positionally."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// gencmn needs a max-size and at least one file\nif len(positional) < 2:\n    raise SystemExit('gencmn usage: gencmn <max-size> <file>...')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep gencmn calls behind the ICU packaging Makefile rather than invoking by hand.","Validate operands in the packaging script before delegating to gencmn."],"tags":["icu","gencmn","cli","arg-parse","packaging"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}