<commit_before>/**
 * Command line implementation for CSScomb
 *
 * Usage example:
 * ./node_modules/.bin/csscomb file1 [dir1 [fileN [dirN]]]
 */
var fs = require('fs');
var program = require('commander');
var vow = require('vow');
var Comb = require('./csscomb');

program
    .version(require('../package.json').version)
    .usage('[options] <file ...>')
    .option('-c, --config [path]', 'configuration file path')
    .parse(process.argv);

var comb = new Comb();
var configPath = program.config || (process.cwd() + '/.csscomb.json');

if (fs.existsSync(configPath)) {
    comb.configure(require(configPath));
    if (program.args.length > 0) {
        vow.all(program.args.map(function(path) {
            return comb.processPath(path);
        })).fail(function(e) {
            console.log('stack: ', e.stack);
            process.exit(1);
        });
    }
} else {
    console.log('Configuration file ' + configPath + ' was not found.');
    process.exit(1);
}
<commit_msg>CLI changes, fixes #64<commit_after>/**
 * Command line implementation for CSSComb
 *
 * Usage example:
 * ./node_modules/.bin/csscomb file1 [dir1 [fileN [dirN]]]
 */
var fs = require('fs');
var program = require('commander');
var vow = require('vow');
var Comb = require('./csscomb');

program
    .version(require('../package.json').version)
    .usage('[options] <file ...>')
    .option('-c, --config [path]', 'configuration file path')
    .parse(process.argv);

if (!program.args.length) {
    console.log('No input paths specified');
    program.help();
}

var configPath = program.config || (process.cwd() + '/.csscomb.json');

if (fs.existsSync(configPath)) {
    var comb = new Comb();
    comb.configure(require(configPath));
    vow.all(program.args.map(function(path) {
        return comb.processPath(path);
    })).fail(function(e) {
        console.log('stack: ', e.stack);
        process.exit(1);
    });
} else {
    console.log('Configuration file ' + configPath + ' was not found.');
    process.exit(1);
}

{'fraction_non_alphanumeric': 0.1908548707753479, 'fraction_numerical': 0.0054671968190854875, 'mean_word_length': 3.211297071129707, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '5721235', 'n_tokens_mistral': 649, 'n_tokens_neox': 643, 'n_words': 139}