mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 05:03:26 +00:00
Add --version/-v flag to CLI (#170)
- Parse --version and -v flags in args.ts - Handle version flag early in main.ts (print and exit) - Add flag to help text - Add comprehensive test coverage for CLI arg parsing Co-authored-by: cc-vps <crcatala+vps@gmail.com>
This commit is contained in:
parent
652ac0fa36
commit
f614892406
3 changed files with 201 additions and 0 deletions
|
|
@ -139,6 +139,11 @@ function prepareInitialMessage(parsed: Args): {
|
|||
export async function main(args: string[]) {
|
||||
const parsed = parseArgs(args);
|
||||
|
||||
if (parsed.version) {
|
||||
console.log(VERSION);
|
||||
return;
|
||||
}
|
||||
|
||||
if (parsed.help) {
|
||||
printHelp();
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue