From 301f8f645d3637c73882c318ae527ccd8b0a9e6e Mon Sep 17 00:00:00 2001 From: Mplan Date: Thu, 18 Jun 2026 01:57:18 +0800 Subject: [PATCH] chore: bump version to 0.1.4 and clean up cli - Set VERSION = '0.1.4' in brand.ts as single source of truth - Import VERSION in cli.ts for --version output - Remove dead code resolveFlagName from cli.ts - Remove hardcoded version comment from index.ts Co-Authored-By: Claude --- src/brand.ts | 2 +- src/cli.ts | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/brand.ts b/src/brand.ts index 1aa4454..9c76c99 100644 --- a/src/brand.ts +++ b/src/brand.ts @@ -2,7 +2,7 @@ import { GREEN, CYAN, RESET } from "./terminal"; -export const VERSION = "0.1.3"; +export const VERSION = "0.1.4"; export function showBanner(): string { const G = GREEN(); diff --git a/src/cli.ts b/src/cli.ts index 1c10a3a..8aff37b 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,6 +1,8 @@ // Lightweight CLI argument parser aligned with mainstream CLI conventions. // Supports: subcommands, short/long flags, flag values, positional args, --help, --version. +import { VERSION } from "./brand"; + export interface FlagDef { long: string; // e.g. "dry-run" short?: string; // e.g. "d" @@ -44,19 +46,6 @@ function buildFlagIndex(flags: FlagDef[]): Map { return index; } -function resolveFlagName(raw: string): { flag: FlagDef; value?: string } | null { - // "--key=value" - const eqIndex = raw.indexOf("="); - if (eqIndex !== -1) { - const name = raw.slice(0, eqIndex); - const value = raw.slice(eqIndex + 1); - const allFlags = buildFlagIndex([...GLOBAL_FLAGS]); // we'll rebuild in context - // We'll handle = syntax in the main parse loop with proper index - return null; // handled inline - } - return null; // handled inline -} - function parseArgs( rawArgs: string[], commands: Map, @@ -282,7 +271,7 @@ export async function runCLI(rawArgs: string[], commands: Map