<commit_before>/*
 * fis
 * http://web.baidu.com/
 */

'use strict';

//kernel
var fis = module.exports = require('fis-kernel');

//exports cli object
fis.cli = {};

//runtime config
fis.cli.rc = {};

//get rc file
fis.cli.rcFile = (function(){
    var name = '.fisrc', conf;
    for(var i = 0, len = arguments.length; i < len; i++){
        var dir = process.env[arguments[i]];
        if(dir){
            conf = fis.util(dir, name);
            break;
        }
    }
    conf = conf || fis.path.getTempPath(name);
    if(!fis.util.exists(conf)){
        fis.util.write(conf, '{}');
    }
    return conf;
})('LOCALAPPDATA', 'APPDATA', 'USERPROFILE', 'HOME');

//commander object
fis.cli.commander = null;

//package.json
fis.cli.info = fis.util.readJSON(__dirname + '/package.json');

//output help info
fis.cli.help = function(){
    var content = [
            '',
            '  usage: fis <command>',
            '',
            '  commands:',
            ''
        ],
        prefix = 'fis-command-',
        prefixLen = prefix.length;
    fis.util.map(fis.cli.info.dependencies, function(name, version){
        if(name.indexOf(prefix) === 0){
            name = name.substring(prefixLen);
            var cmd = fis.require('command', name);
            name = fis.util.pad(cmd.name || name, 12);
            content.push('    ' + name + (cmd.desc || ''));
        }
    });
    content = content.concat([
        '',
        '  options:',
        '',
        '    -h, --help     output usage information',
        '    -v, --version  output the version number',<commit_msg>完成fis命令行系统<commit_after>/*
 * fis
 * http://web.baidu.com/
 */

'use strict';

//kernel
var fis = module.exports = require('fis-kernel');

//exports cli object
fis.cli = {};

//runtime config
fis.cli.rc = {};

//get rc file
fis.cli.rcFile = (function(){
    var name = '.fisrc', conf;
    for(var i = 0, len = arguments.length; i < len; i++){
        var dir = process.env[arguments[i]];
        if(dir){
            conf = fis.util(dir, name);
            break;
        }
    }
    conf = conf || fis.path.getTempPath(name);
    if(!fis.util.exists(conf)){
        fis.util.write(conf, '{}');
    }
    return conf;
})('LOCALAPPDATA', 'APPDATA', 'USERPROFILE', 'HOME');

//commander object
fis.cli.commander = null;

//package.json
fis.cli.info = fis.util.readJSON(__dirname + '/package.json');

//output help info
fis.cli.help = function(){
    var content = [
            '',
            '  usage: fis <command>',
            '',
            '  commands:',
            ''
        ],
        prefix = 'fis-command-',
        prefixLen = prefix.length;
    fis.util.map(fis.cli.info.dependencies, function(name, version){
        if(name.indexOf(prefix) === 0){
            name = name.substring(prefixLen);
            try {
                var cmd = fis.require('command', name);
                name = fis.util.pad(cmd.name || name, 12);
                content.push('    ' + name + (cmd.desc || ''));
            } catch(e){
                //do nothing.
            }
        }
    });
    content = content.concat([
        '',
        '  options:',
        '',
        '    -h, --help     output usage information',
        '    -v, --version  output the version number',
{'fraction_non_alphanumeric': 0.1773353751914242, 'fraction_numerical': 0.002450229709035222, 'mean_word_length': 1.7843137254901962, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5458401', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1065, 'n_words': 219}