fix(cli): support case-insensitive version and help flags and subcommands

This commit is contained in:
gitea committed 2026-09-05 22:16:56 +08:00
1 parent c99c5d98ec
commit 269b7e8f0f
3 files changed
+56 -22

No files matched your search

+16
View File
@@ -5,11 +5,19 @@ import { VERSION } from "../version.js";
describe("CLI runner - version and help aliases", () => {
const versionVariants = [
["version"],
["verSion"],
["versioN"],
["VERSION"],
["Version"],
["v"],
["V"],
["-v"],
["-V"],
["--version"],
["--verSion"],
["--VERSION"],
["--v"],
["--V"],
];
for (const args of versionVariants) {
@@ -24,9 +32,17 @@ describe("CLI runner - version and help aliases", () => {
const helpVariants = [
[],
["help"],
["HeLp"],
["HELP"],
["h"],
["H"],
["-h"],
["-H"],
["--help"],
["--HeLp"],
["--HELP"],
["?"],
["-?"],
];
for (const args of helpVariants) {