mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
cli: align config aware commands options
This commit is contained in:
16
app/src/cli/utils/options.ts
Normal file
16
app/src/cli/utils/options.ts
Normal 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;
|
||||
Reference in New Issue
Block a user