{"record":{"id":"726b79a85d06aada","repo":"nodejs/node","slug":"1-726b79","errorCode":"1","errorMessage":"%s: error in command line argument \"%s\"\n","messagePattern":"(.+?): error in command line argument \"(.+?)\"\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":300,"sourceCode":"    U_MAIN_INIT_ARGS(argc, argv);\n\n    progname = argv[0];\n\n    options[MODE].value = \"common\";\n\n    /* read command line options */\n    argc=u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);\n\n    /* error handling, printing usage message */\n    /* I've decided to simply print an error and quit. This tool has too\n    many options to just display them all of the time. */\n\n    if(options[HELP].doesOccur || options[HELP_QUESTION_MARK].doesOccur) {\n        needsHelp = true;\n    }\n    else {\n        if(!needsHelp && argc<0) {\n            fprintf(stderr,\n                \"%s: error in command line argument \\\"%s\\\"\\n\",\n                progname,\n                argv[-argc]);\n            fprintf(stderr, \"Run '%s --help' for help.\\n\", progname);\n            return 1;\n        }\n\n\n#if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)\n        if(!options[BLDOPT].doesOccur && uprv_strcmp(options[MODE].value, \"common\") != 0) {\n          if (pkg_getPkgDataPath(options[VERBOSE].doesOccur, &options[BLDOPT]) != 0) {\n                fprintf(stderr, \" required parameter is missing: -O is required for static and shared builds.\\n\");\n                fprintf(stderr, \"Run '%s --help' for help.\\n\", progname);\n                return 1;\n            }\n        }\n#else\n        if(options[BLDOPT].doesOccur) {","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L282-L318","documentation":"pkgdata's u_parseArgs returned a negative argc, meaning an unrecognized or malformed argument; the offending token is argv[-argc]. pkgdata prints it and returns exit code 1. Fires before any of the -O/-p/input-file checks.","triggerScenarios":"Unknown flag (e.g. `--modd`), a flag missing its value, or malformed option syntax.","commonSituations":"Typo in an option name; version skew (flag renamed/removed across ICU versions); unquoted shell glob producing unexpected tokens.","solutions":["Inspect the printed token — it is the exact argument u_parseArgs rejected.","Run `pkgdata --help` to see the valid option set for this build.","Quote shell arguments to prevent glob/word-splitting."],"exampleFix":"# before\npkgdata --modd common\n# after\npkgdata --mode common","handlingStrategy":"validation","validationCode":"# bash: validate the option set your script uses before calling\npkgdata --help >/dev/null 2>&1 || { echo \"pkgdata missing\"; exit 2; }\n# quote all args; reject unquoted globs in the wrapper","typeGuard":null,"tryCatchPattern":"# log stderr so the offending token is captured\nerr=\"$(pkgdata \"$@\" 2>&1 >/dev/null)\" || { echo \"pkgdata: $err\" >&2; exit 1; }","preventionTips":["Pin the ICU version so the pkgdata option set doesn't shift under you.","Quote every argument; never let a glob expand unquoted."],"tags":["icu","pkgdata","cli","arguments"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}