nodejs/node · error

error in command line argument "%s"\n

Error message

error in command line argument "%s"\n

What it means

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.

Source

Thrown at deps/icu-small/source/tools/gencmn/gencmn.c:62

/*7*/ UOPTION_DEF( "type", 't', UOPT_REQUIRES_ARG),
/*8*/ UOPTION_DEF( "source", 'S', UOPT_NO_ARG),
/*9*/ UOPTION_DEF( "entrypoint", 'e', UOPT_REQUIRES_ARG),
/*10*/UOPTION_SOURCEDIR,
};

extern int
main(int argc, char* argv[]) {
    UBool sourceTOC, verbose;
    uint32_t maxSize;

    U_MAIN_INIT_ARGS(argc, argv);

    /* preset then read command line options */
    argc=u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);

    /* error handling, printing usage message */
    if(argc<0) {
        fprintf(stderr,
            "error in command line argument \"%s\"\n",
            argv[-argc]);
    } else if(argc<2) {
        argc=-1;
    }

    if(argc<0 || options[0].doesOccur || options[1].doesOccur) {
        FILE *where = argc < 0 ? stderr : stdout;

        /*
         * Broken into chucks because the C89 standard says the minimum
         * required supported string length is 509 bytes.
         */
        fprintf(where,
                "%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);
        if (options[0].doesOccur || options[1].doesOccur) {
            fprintf(where, "\n"
                "Read the list file (default: standard input) and create a common data\n"

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Run gencmn with no args or -h to read its usage and supply the required max-size and file operands.
  2. Correct the offending token named in the message in your packaging script.
  3. Ensure at least the size argument and one file name are passed positionally.
Defensive patterns

Strategy: validation

Validate before calling

// gencmn needs a max-size and at least one file
if len(positional) < 2:
    raise SystemExit('gencmn usage: gencmn <max-size> <file>...')

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/a8b790fbfc2cba54. Report an issue: GitHub.