<commit_before>#!/usr/bin/env node
import chalk from 'chalk';
import execa from 'execa';
import inquirer from 'inquirer';
import updateNotifier from 'update-notifier';

import pkg from '../package.json';
import getConfig from './getConfig';
import { choices, questions } from './promptConfig';

const configuration = getConfig();
const choicesList = choices(configuration);
const questionsList = questions(choicesList);

updateNotifier({ pkg }).notify();

inquirer.prompt(questionsList).then((answers) => {
  const message = answers.moreInfo ? `${answers.editor}` : `${answers.type} ${answers.description}`;

  return execa('git', ['commit', '-m', message])
    .then(result => console.log(result.stdout))
    .catch(() => {
      console.log();
      console.error(chalk.red("Have you thought about 'git add' some files? Add files and try run following again:\n"));
      console.error(chalk.green(`git commit -m "${message}"`));
    });
});
<commit_msg>:sparkles: Feat: add -v and -h flags<commit_after>#!/usr/bin/env node
import chalk from 'chalk';
import execa from 'execa';
import yargs from 'yargs';
import inquirer from 'inquirer';
import updateNotifier from 'update-notifier';

import pkg from '../package.json';
import getConfig from './getConfig';
import { choices, questions } from './promptConfig';

const configuration = getConfig();
const choicesList = choices(configuration);
const questionsList = questions(choicesList);
const argv = yargs
  .usage('Usage: $0')
  .alias('v', 'version')
  .describe('v', 'Version number')
  .help('h')
  .alias('h', 'help')
  .argv;

updateNotifier({ pkg }).notify();

if (argv.v) {
  console.log(`v${pkg.version}`);
} else {
  inquirer.prompt(questionsList).then((answers) => {
    const message = answers.moreInfo ? `${answers.editor}` : `${answers.type} ${answers.description}`;

    return execa('git', ['commit', '-m', message])
      .then(result => console.log(result.stdout))
      .catch(() => {
        console.error(chalk.red("Have you thought about 'git add' some files? Add files and try run following again:\n"));
        console.error(chalk.green(`git commit -m "${message}"`));
      });
  });
}


{'fraction_non_alphanumeric': 0.17668825161887142, 'fraction_numerical': 0.00046253469010175765, 'mean_word_length': 4.462121212121212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '41799', 'n_tokens_mistral': 681, 'n_tokens_neox': 660, 'n_words': 183}