{"record":{"id":"f5e7505cc72cbe0f","repo":"nodejs/node","slug":"error-in-command-line-argument-s-n","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/genccode/genccode.c","lineNumber":114,"sourceCode":"\n#define CALL_WRITECCODE     'c'\n#define CALL_WRITEASSEMBLY  'a'\n#define CALL_WRITEOBJECT    'o'\nextern int\nmain(int argc, char* argv[]) {\n    UBool verbose = true;\n    char writeCode;\n\n    U_MAIN_INIT_ARGS(argc, argv);\n\n    options[kOptDestDir].value = \".\";\n\n    /* 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    }\n    if(argc<0 || options[kOptHelpH].doesOccur || options[kOptHelpQuestionMark].doesOccur) {\n        fprintf(stderr,\n            \"usage: %s [-options] filename1 filename2 ...\\n\"\n            \"\\tread each binary input file and \\n\"\n            \"\\tcreate a .c file with a byte array that contains the input file's data\\n\"\n            \"options:\\n\"\n            \"\\t-h or -? or --help  this usage text\\n\"\n            \"\\t-d or --destdir     destination directory, followed by the path\\n\"\n            \"\\t-q or --quiet       do not display warnings and progress\\n\"\n            \"\\t-n or --name        symbol prefix, followed by the prefix\\n\"\n            \"\\t-e or --entrypoint  entry point name, followed by the name (_dat will be appended)\\n\"\n            \"\\t-r or --revision    Specify a version\\n\"\n            , argv[0]);\n#ifdef CAN_GENERATE_OBJECTS\n        fprintf(stderr,","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genccode/genccode.c#L96-L132","documentation":"genccode uses ICU's u_parseArgs to process its option vector. u_parseArgs returns a negative value when it encounters an unrecognized or malformed argument; genccode echoes that offending argument via argv[-argc]. This is the catch-all for any CLI that u_parseArgs could not match against the registered options.","triggerScenarios":"Passing an unknown flag (e.g. --foo), a flag that requires an argument but is given none, a value the parser rejects, or a malformed short-option cluster. argv[-argc] indexes the exact token at fault.","commonSituations":"Typo'd flag name in a Makefile/CMake rule; using a newer/older genccode option against a build script written for a different ICU version; quoting mistake that fuses two options into one token; copying a command from docs for a different tool.","solutions":["Run genccode -h to see the supported options for this build and correct the offending token shown in the message.","Check the build script (Makefile/CMake/GN) for typos in the genccode invocation.","Confirm the option exists in your ICU version — some flags (e.g. -o/--object, -c/--cpu-arch) are only compiled in when CAN_GENERATE_OBJECTS is defined."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// validate the genccode argv against the known option spec before exec\nvalid = {'-h','-?','--help','-d','--destdir','-q','--quiet','-n','--name','-e','--entrypoint','-f','--filename','-a','--assembly'}\nbad = [a for a in argv[1:] if a.startswith('-') and a not in valid]\nif bad: raise SystemExit(f'unknown genccode option(s): {bad}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Centralize the genccode invocation in one build helper so flags are reviewed once.","Read genccode -h after upgrading ICU to catch removed/added options."],"tags":["icu","genccode","cli","arg-parse"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}