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

var minimist = require('minimist')
var path = require('path')

var commands = [ 'fetch', 'compile', 'build', 'check', 'launch' ]
var argv = minimist(process.argv.slice(2), {
  string: commands,
  alias: {
    help: 'h',
    version: 'v'
  }
})

var usage = `
  Usage:
    $ sibyl <command> [options]

  Commands:
    fetch      Fetch a bundle
    check      Check a bundle's content
    compile    Compile a bundle
    build      Build a bundle image
    launch     Launch a bundle container

  Options:
    -h, --help              Print usage
    -v, --version           Print version

  Examples:
    sibyl fetch --help    Print usage for the "fetch" command
`

;(function main (argv) {
  var subcommand = argv._[0]
  if (commands.indexOf(subcommand) === -1) {
    console.log('Please provide a valid command from the list below.')
    console.log(usage)
  } else if (argv.help && !subcommand) {
    console.log(usage)
  } else if (argv.version) {
    console.log(require('./package.json').version)
  } else {
    var sub = require(path.join(__dirname, subcommand))
    sub(process.argv.slice(3))
  }<commit_msg>Don't print missing subcommand error if user just wants help<commit_after>#!/usr/bin/env node

var minimist = require('minimist')
var path = require('path')

var commands = [ 'fetch', 'compile', 'build', 'check', 'launch' ]
var argv = minimist(process.argv.slice(2), {
  string: commands,
  alias: {
    help: 'h',
    version: 'v'
  }
})

var usage = `
  Usage:
    $ sibyl <command> [options]

  Commands:
    fetch      Fetch a bundle
    check      Check a bundle's content
    compile    Compile a bundle
    build      Build a bundle image
    launch     Launch a bundle container

  Options:
    -h, --help              Print usage
    -v, --version           Print version

  Examples:
    sibyl fetch --help    Print usage for the "fetch" command
`

;(function main (argv) {
  var subcommand = argv._[0]
  if (argv.help && !subcommand) {
    console.log(usage)
  } else if (argv.version) {
    console.log(require('./package.json').version)
  } else if (commands.indexOf(subcommand) === -1) {
    console.log('Please provide a valid command from the list below.')
    console.log(usage)
  } else {
    var sub = require(path.join(__dirname, subcommand))
    sub(process.argv.slice(3))
  }
{'fraction_non_alphanumeric': 0.1308052833404346, 'fraction_numerical': 0.0034086067319982955, 'mean_word_length': 2.691823899371069, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1717274', 'n_tokens_mistral': 755, 'n_tokens_neox': 734, 'n_words': 225}