Skip to content

Commit 2c48e4c

Browse files
committed
feat(cli): support --version option
1 parent 5cdf88e commit 2c48e4c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: src/index.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,9 @@ ${chalk.underline('Commands:')}
1919
2020
${chalk.underline('Options:')}
2121
-h, --help Print help (see more with '--help')
22-
-V, --version Print version
22+
-v, --version Print version
2323
`)
2424
}
25-
if (argv._[0] !== 'sg' || argv.help || argv.h) {
26-
printHelp()
27-
process.exit()
28-
}
2925

3026
const dirname = path.dirname(fileURLToPath(import.meta.url))
3127
if (argv.v || argv.version) {
@@ -34,6 +30,11 @@ if (argv.v || argv.version) {
3430
process.exit()
3531
}
3632

33+
if (argv._[0] !== 'sg' || argv.help || argv.h) {
34+
printHelp()
35+
process.exit()
36+
}
37+
3738
$.verbose = false
3839

3940
let macro = await select({

0 commit comments

Comments
 (0)