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

"use strict"

var fs = require('fs')
var path = require('path')

var minimist = require('minimist')

var lsr = require('lsr')
var mkdirp = require('mkdirp')
var once = require('once')

var BOILERPLATE_DIR = path.resolve(__dirname, '..', 'boilerplate')

var argv = minimist(process.argv, { alias: { h: 'help' } })
var cmd = argv._[2]

if (cmd === 'init') {
  var dest = process.cwd()
  cpr(BOILERPLATE_DIR, dest, function(err, files) {
    if (err) return done(err, files)
    fs.chmod(path.resolve(process.cwd(), 'index.js'), '755', function(err) {
      return done(err, files)
    })
  })
} else if (cmd === 'new') {
  var name = argv._[3]
  if (!name) return done(new Error('exercise name required.'))
  var dest = path.resolve(process.cwd(), 'exercises', name)
  mkdirp(dest, function(err) {
    if (err) return done(err)
    cpr(path.resolve(BOILERPLATE_DIR, 'exercises', 'example'), dest, done)
  })
} else {
  console.log(usage())
  process.exit(1)
}
<commit_msg>Exit with 0 code when using --help.<commit_after>#!/usr/bin/env node

"use strict"

var fs = require('fs')
var path = require('path')

var minimist = require('minimist')

var lsr = require('lsr')
var mkdirp = require('mkdirp')
var once = require('once')

var BOILERPLATE_DIR = path.resolve(__dirname, '..', 'boilerplate')

var argv = minimist(process.argv, { alias: { h: 'help' } })
var cmd = argv._[2]

if (cmd === 'init') {
  var dest = process.cwd()
  cpr(BOILERPLATE_DIR, dest, function(err, files) {
    if (err) return done(err, files)
    fs.chmod(path.resolve(process.cwd(), 'index.js'), '755', function(err) {
      return done(err, files)
    })
  })
} else if (cmd === 'new') {
  var name = argv._[3]
  if (!name) return done(new Error('exercise name required.'))
  var dest = path.resolve(process.cwd(), 'exercises', name)
  mkdirp(dest, function(err) {
    if (err) return done(err)
    cpr(path.resolve(BOILERPLATE_DIR, 'exercises', 'example'), dest, done)
  })
} else {
  console.log(usage())
  process.exit(argv.help ? 0 : 1)
}

{'fraction_non_alphanumeric': 0.18634146341463415, 'fraction_numerical': 0.006829268292682927, 'mean_word_length': 4.089330024813896, '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': '1941197', 'n_tokens_mistral': 779, 'n_tokens_neox': 761, 'n_words': 188}