refactor(lmc): use short property for options and simplify flags

This commit is contained in:
mitchell 2026-06-26 17:06:12 -04:00
parent b1730bfaf4
commit 5b6c65d30f

View file

@ -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");