chore: release v0.1.4 with npm packaging and shared helpers #7

Merged
Mplan merged 12 commits from v0.1.4 into main 2026-06-23 23:11:59 +08:00
2 changed files with 4 additions and 15 deletions
Showing only changes of commit 301f8f645d - Show all commits

No files matched your search

+1 -1
View File
@@ -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();
+3 -14
View File
@@ -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<string, FlagDef> {
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<string, CommandDef>,
@@ -282,7 +271,7 @@ export async function runCLI(rawArgs: string[], commands: Map<string, CommandDef
// Handle --version globally
if (result.flags["version"]) {
console.log("gai v0.1.3");
console.log(`gai v${VERSION}`);
return 0;
}