cli: align config aware commands options

This commit is contained in:
dswbx committed 2025-08-29 09:40:27 +02:00
1 parent 93019827b0
commit c04ad89a86
7 files changed
+49 -45

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { type Command, Option } from "commander";
export function withConfigOptions(program: Command) {
return program
.addOption(new Option("-c, --config <config>", "config file"))
.addOption(
new Option("--db-url <db>", "database url, can be any valid sqlite url").conflicts(
"config",
),
);
}
export type WithConfigOptions<CustomOptions = {}> = {
config?: string;
dbUrl?: string;
} & CustomOptions;