Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
feat: 🎸 add --disable-emoji to --help and parse from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed May 16, 2020
1 parent 8debcfe commit 82dd0c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ const executeCommand = (command, args = [], env = process.env) => {

const main = async () => {
try {
const state = createState();

const {cliAnswers, cliOptions, passThroughParams} = parseArgs();

if (cliOptions.dryRun) {
// eslint-disable-next-line no-console
console.log('Running in dry mode.');
}

const state = createState({disableEmoji: cliOptions['disable-emoji']});
const state = createState({disableEmoji: cliOptions.disableEmoji});

if (cliOptions.nonInteractive) {
await runNonInteractiveMode(state, cliAnswers);
Expand Down
5 changes: 4 additions & 1 deletion lib/parseArgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const helpScreen = `
options:
-h, --help show usage information
-v, --version print version info and exit
--disable-emoji don't add emoji to commit title
--non-interactive run git-cz in non-interactive mode
non-interactive mode options:
Expand All @@ -30,6 +31,7 @@ const parseArgs = () => {
_: inputs,
'dry-run': dryRun,
hook,
'disable-emoji': disableEmoji,
'non-interactive': nonInteractive,
body,
breaking,
Expand All @@ -48,7 +50,7 @@ const parseArgs = () => {
h: 'help',
v: 'version'
},
boolean: ['version', 'help', 'non-interactive', 'hook', 'dry-run'],
boolean: ['version', 'help', 'disable-emoji', 'non-interactive', 'hook', 'dry-run'],
string: ['type', 'subject', 'scope', 'body', 'breaking', 'issues', 'learna']
});

Expand All @@ -63,6 +65,7 @@ const parseArgs = () => {
}

const cliOptions = {
disableEmoji,
dryRun,
help,
hook,
Expand Down

0 comments on commit 82dd0c9

Please sign in to comment.