fix(cli): support version and help aliases (v, V, -V, h, -h)
This commit is contained in:
1 parent
40b3b29ca5
commit
4fbd737402
3 files changed
+65
-3
No files matched your search
+2
-1
@@ -8,6 +8,7 @@ const KNOWN_BOOLEAN_FLAGS = new Set([
|
||||
"h",
|
||||
"version",
|
||||
"v",
|
||||
"V",
|
||||
"force",
|
||||
"f",
|
||||
"stateless",
|
||||
@@ -67,7 +68,7 @@ export function parseArgs(rawArgs: string[]): CliParsedArgs {
|
||||
const flag = arg.slice(1);
|
||||
if (flag === "h") options.help = true;
|
||||
else if (flag === "j") options.json = true;
|
||||
else if (flag === "v") options.version = true;
|
||||
else if (flag === "v" || flag === "V") options.version = true;
|
||||
else if (flag === "o") {
|
||||
const next = rawArgs[i + 1];
|
||||
if (next && !next.startsWith("-")) {
|
||||
|
||||
Reference in new issue
Block a user