From 5b6c65d30f9c9403050fdbce86a9e7d16948f3e2 Mon Sep 17 00:00:00 2001 From: mitchell Date: Fri, 26 Jun 2026 17:06:12 -0400 Subject: [PATCH] refactor(lmc): use short property for options and simplify flags --- src/index.ts | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/src/index.ts b/src/index.ts index be9e0f1..59e6635 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,40 +22,32 @@ async function main() { const { values: args, positionals } = util.parseArgs({ args: process.argv.slice(2), options: { - model: { type: "string" }, - m: { type: "string" }, - new: { type: "boolean" }, - n: { type: "boolean" }, - config: { type: "boolean" }, - c: { type: "boolean" }, + model: { type: "string", short: "m" }, + new: { type: "boolean", short: "n" }, + config: { type: "boolean", short: "c" }, plain: { type: "boolean" }, "plain-out": { type: "boolean" }, "plain-err": { type: "boolean" }, - version: { type: "boolean" }, - v: { type: "boolean" }, - "git-message": { type: "boolean" }, - g: { type: "boolean" }, - review: { type: "boolean" }, - r: { type: "boolean" }, - file: { type: "string" }, - f: { type: "string" }, - stdin: { type: "boolean" }, - i: { type: "boolean" }, + version: { type: "boolean", short: "v" }, + "git-message": { type: "boolean", short: "g" }, + review: { type: "boolean", short: "r" }, + file: { type: "string", short: "f" }, + stdin: { type: "boolean", short: "i" }, }, strict: true, allowPositionals: true, }); - const newConvo = args.new ?? args.n; + const newConvo = args.new; const plainOut = args["plain-out"] ?? args.plain ?? !process.stdout.isTTY; const plainErr = args["plain-err"] ?? args.plain ?? !process.stderr.isTTY; - const modelOverride = args.model ?? args.m; - const showVersion = args.version ?? args.v; - const editConfig = args.config ?? args.c; - const generateGitMessage = args["git-message"] ?? args.g; - const generateReview = args.review ?? args.r; - const inputFile = args.file ?? args.f; - const stdinContent = args.stdin ?? args.i; + const modelOverride = args.model; + const showVersion = args.version; + const editConfig = args.config; + const generateGitMessage = args["git-message"]; + const generateReview = args.review; + const inputFile = args.file; + const stdinContent = args.stdin; if (showVersion) { console.log("0.0.0");