Skip to content

Commit a8b7546

Browse files
committed
feat(gen-config): change '--gen-config' option to 'init' command
1 parent 2b93432 commit a8b7546

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

lib/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,19 @@ program
7878
.option('-i, --interactive', 'run interactive mode')
7979
.option('-S, --silent', "don't show commit command")
8080
.option('-t, --typo-check', '[Already deleted this function] check spell')
81-
.option('--gen-config', 'generate config files')
8281
.version(version)
8382

84-
if (process.argv.includes('--gen-config')) {
83+
program
84+
.command('init')
85+
.description('generate config files')
86+
.option('-D, --dry-run', 'run dry-run mode')
87+
.action(() => {
88+
/* no-op */
89+
})
90+
91+
if (process.argv[2] === 'init') {
8592
program.parse(process.argv)
93+
8694
genConfig(program, templateFileName, definitionsFileName)
8795
} else {
8896
const projectRoot = getProjectRoot()

0 commit comments

Comments
 (0)