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

'use strict';
var log              =  require('npmlog')
  , resolveGitRemote =  require('resolve-git-remote')
  , getConfig        =  require('../lib/get-config')
  , updatePackage    =  require('../lib/update-package')
  , createHook       =  require('../lib/create-testling-hook')
  , testHook         =  require('../lib/test-testling-hook')
  ;

var task = (function () {
  var arg = process.argv[2];
  if (!arg) return 'hook';

  arg = arg.toLowerCase();
  if (arg === 'test' || arg === 'badge') return arg;

  if (arg === "-h" || arg === "--help") {
    return console.log("usage:\n" +
      "run testlingify to add hooks.\n" +
      "run testlingify test to test the hook")
  }

  log.error('testlingify', 'unknown task: ' + arg);
  process.exit(1);<commit_msg>improving help output and exiting immediately<commit_after>#!/usr/bin/env node

'use strict';
var log              =  require('npmlog')
  , resolveGitRemote =  require('resolve-git-remote')
  , getConfig        =  require('../lib/get-config')
  , updatePackage    =  require('../lib/update-package')
  , createHook       =  require('../lib/create-testling-hook')
  , testHook         =  require('../lib/test-testling-hook')
  ;

var task = (function () {
  var arg = process.argv[2];
  if (!arg) return 'hook';

  arg = arg.toLowerCase();
  if (arg === 'test' || arg === 'badge') return arg;

  if (arg === "-h" || arg === "--help") {
    console.log(
      'usage: testlingify            (adds testling hook to github and testling config to package.json)\n' +
      '       testlingify test       (tests testling github hook on)\n' +
      '       testlingify badge      (prints testling badge)');

    process.exit(0);
  }

  log.error('testlingify', 'unknown task: ' + arg);
  process.exit(1);
{'fraction_non_alphanumeric': 0.17954419121734297, 'fraction_numerical': 0.0027793218454697055, 'mean_word_length': 2.585657370517928, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2835703', 'n_tokens_mistral': 600, 'n_tokens_neox': 586, 'n_words': 136}