<commit_before>#!/usr/bin/env node

'use strict';

var program        = require('commander'),
    projectVersion = require('../package.json').version,
    _              = require('lodash'),
    chalk          = require('chalk');

program
  .version(projectVersion)
  .option('-d, --directory [folder]', 'Specify the folder where knick-knack should look for project templates [~/.knick-knack]', '~/.knick-knack');

//specify additional help text
program.on('--help', function(){
  console.log('  ' + chalk.cyan.underline('Commands:'));
  console.log('');
  console.log('    $ knick-knack                    List all available project templates');
  console.log('    $ knick-knack init               Initialize a valid knick-knack project templates folder');
  console.log('    $ knick-knack check              Check which "features" the project in the current folder has (eg. a GIT project, Jenkins job,...)');
  console.log('    $ knick-knack xp/rest-client     Generate a new xp project of type rest-client');
  console.log('    $ knick-knack add general/readme Add a readme partial to an existing project');
  console.log('    $ knick-knack create git-project Create a Git project for the project in the current folder');
  console.log('    $ knick-knack create jenkins-job Create a Jenkins job for the project in the current folder');
  console.log('');
});

program.parse(process.argv);
var additionalArgs = program.args,
    directory      = program.directory;

/* Find the right subroutine to call */
var list = require('../lib/list'),
    init = require('../lib/init');

switch (additionalArgs[0]) {
  case undefined:
    var templates = list.listProjects(directory);
    _.forEach(templates, function(templateName) {
      console.log(chalk.yellow('A valid template name must be specified.\n'));
      console.log(chalk.green.underline('Available templates:'));
      console.log(templateName);
      console.log('\n');
      console.log('You can run a template with "knick-knack TEMPLATE".\n');
      console.log('For more information see https://github.com/haimich/knick-knack');
    });
    break;
  case 'init':
    init.createTemplateFolder(directory);
    break;
  case 'check':
    console.log('check');
    break;
  case 'add':
    console.log('add ' + additionalArgs[1]);
    break;
  case 'create':
    console.log('create ' + additionalArgs[1]);
    break;
  default:
    console.log('generate ' + additionalArgs[0]);
}<commit_msg>color!<commit_after>#!/usr/bin/env node

'use strict';

var program        = require('commander'),
    projectVersion = require('../package.json').version,
    _              = require('lodash'),
    chalk          = require('chalk');

program
  .version(projectVersion)
  .option('-d, --directory [folder]', 'Specify the folder where knick-knack should look for project templates [~/.knick-knack]', '~/.knick-knack');

//specify additional help text
program.on('--help', function(){
  console.log('  ' + chalk.cyan.underline('Commands:'));
  console.log('');
  console.log('    $ knick-knack                    List all available project templates');
  console.log('    $ knick-knack init               Initialize a valid knick-knack project templates folder');
  console.log('    $ knick-knack check              Check which "features" the project in the current folder has (eg. a GIT project, Jenkins job,...)');
  console.log('    $ knick-knack xp/rest-client     Generate a new xp project of type rest-client');
  console.log('    $ knick-knack add general/readme Add a readme partial to an existing project');
  console.log('    $ knick-knack create git-project Create a Git project for the project in the current folder');
  console.log('    $ knick-knack create jenkins-job Create a Jenkins job for the project in the current folder');
  console.log('');
});

program.parse(process.argv);
var additionalArgs = program.args,
    directory      = program.directory;

/* Find the right subroutine to call */
var list = require('../lib/list'),
    init = require('../lib/init');

switch (additionalArgs[0]) {
  case undefined:
    var templates = list.listProjects(directory);
    _.forEach(templates, function(templateName) {
      console.log(chalk.yellow('A valid template name must be specified.\n'));
      console.log(chalk.cyan.underline('Available templates:'));
      console.log(templateName);
      console.log('\n');
      console.log('You can run a template with "knick-knack TEMPLATE".\n');
      console.log('For more information see https://github.com/haimich/knick-knack');
    });
    break;
  case 'init':
    init.createTemplateFolder(directory);
    break;
  case 'check':
    console.log('check');
    break;
  case 'add':
    console.log('add ' + additionalArgs[1]);
    break;
  case 'create':
    console.log('create ' + additionalArgs[1]);
    break;
  default:
    console.log('generate ' + additionalArgs[0]);
}
{'fraction_non_alphanumeric': 0.1448712709440131, 'fraction_numerical': 0.0016346546791990192, 'mean_word_length': 3.1801878736122973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '721107', 'n_tokens_mistral': 1441, 'n_tokens_neox': 1427, 'n_words': 400}