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:
committed by
GitHub
parent
652ac0fa36
commit
f614892406
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user