Skip to content

Commit 27b1ccd

Browse files
armano2marionebl
authored andcommitted
fix(cli): improve help format and setup version command
1 parent bb12a02 commit 27b1ccd

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

@commitlint/cli/src/cli.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,23 @@ const cli = yargs
8989
'upper end of the commit range to lint; applies if edit=false',
9090
type: 'string'
9191
},
92-
version: {
93-
alias: 'v',
94-
type: 'boolean',
95-
description: 'display version information'
96-
},
9792
verbose: {
9893
alias: 'V',
9994
type: 'boolean',
10095
description: 'enable verbose output for reports without problems'
10196
}
10297
})
103-
.help(
104-
'help',
105-
`${pkg.name}@${pkg.version} - ${pkg.description}\n` +
106-
`[input] reads from stdin if --edit, --env, --from and --to are omitted`
98+
.version(
99+
'version',
100+
'display version information',
101+
`${pkg.name}@${pkg.version}`
102+
)
103+
.alias('v', 'version')
104+
.help('help')
105+
.alias('h', 'help')
106+
.usage(`${pkg.name}@${pkg.version} - ${pkg.description}`)
107+
.usage(
108+
`[input] reads from stdin if --edit, --env, --from and --to are omitted`
107109
).argv;
108110

109111
main(cli).catch(err => {

0 commit comments

Comments
 (0)