Hi,
Thanks for the library and the great effort.
I need help with an issue:
When I set allowUnknownFlags
to false
, camel-case flags are reported as unknown flag
. However, when I set allowUnknownFlags
to true
, both camel-cased and dash-cased flags populate the same camel case key (e.g. out-dir
and outDir
result with { flags: outDir: "xxx" }
).
I expected when allowUnknownFlags
is true
, both types of flags are allowed, because dash cased flags are already converted to camel case in the result object.
Please see examples below:
allowUnknownFlags: false
with camel-case flagconst flags = { outDir: { type: "string", desc: "Some desc." } };
const result = meow("some help", { flags, allowUnknownFlags: false });
console.log(result.flags);
Command: $ cmd --outDir models
Result: Unknown flag --outDir
Expected: { outDir: "models" }
allowUnknownFlags: true
const flags = { outDir: { type: "string", desc: "Some desc." } };
const result = meow("some help", { flags, allowUnknownFlags: true });
console.log(result.flags);
Command: $ cmd --outDir models
Result: { outDir: "models" }
Command: $ cmd --out-dir models
Result: { outDir: "models" }
Kind Regards,
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too