<commit_before>'use strict';

function interactive (value, parsed) {
    if(value){
        parsed.interactive = true;
    }

    return value;
};


exports.options = {
    list: {
        type: Boolean,
        short: 'l',
        info: 'show the list of available options.',
        value: interactive
    },

    edit: {
        type: Boolean,
        short: 'e',
        info: 'opens an editor to modify the config file.',
        value: interactive
    },

    unset: {
        type: Boolean,
        info: 'unset an option.'
    },

    'unset-all': {
        type: Boolean,
        info: 'unset all options.'
    },

    name: {
        type: String,
        info: 'the name of the property.',
        value: function (name, parsed, tools) {
            if(parsed['unset-all']){
                return;
            }

            if(!parsed.interactive && !name){
                var remain = parsed.argv && parsed.argv.remain || [];

                // cortex config <key> <value>
                var v = remain.shift();

                if(!v){
                    tools.error('You must specify a name of the property to be configured');
                }else{
                    return v;
                }
            }
        }
    },

    value: {
        type: String,
        info: 'the new value of the specified property.',
        value: function (value, parsed, tools) {
            if(parsed['unset-all'] || parsed.unset){
                return;
            }

            if(!parsed.interactive && !value){
                var remain = parsed.argv && parsed.argv.remain || [];

                // cortex config <key> <value>
                var v = remain.shift();

                return v;<commit_msg>fixes #98: config/option: Migrate to comfort@2.1.x;<commit_after>'use strict';

function interactive (value) {
    if(value){
        this.set('interactive', true);
    }

    return value;
};


exports.shorthands = {
    l: 'list',
    e: 'edit'
};


exports.options = {
    list: {
        type: Boolean,
        info: 'show the list of available options.',
        setter: interactive
    },

    edit: {
        type: Boolean,
        info: 'opens an editor to modify the config file.',
        setter: interactive
    },

    unset: {
        type: Boolean,
        info: 'unset an option.'
    },

    'unset-all': {
        type: Boolean,
        info: 'unset all options.'
    },

    name: {
        type: String,
        info: 'the name of the property.',
        setter: function (name) {
            var done = this.async();

            if(this.get('unset-all')){
                return done(null);
            }

            if(!this.get('interactive') && !name){
                var remain = this.get('_');

                // cortex config <key> <value>
                var v = remain.shift();

                if(!v){
                    return done('You must specify a name of the property to be configured');
                }else{
                    return done(null, v);
                }
            }

            done(null);
        }
    },

    value: {
        type: String,
        info: 'the new value of the specified property.',
        setter: function (value) {
            if(this.get('unset-all') || this.get('unset') ){
                return;
            }

            if(!this.get('interactive') && !value){
                var remain = this.get('_');

                // cortex config <key> <value>
                var v = remain.shift();

                return v;
{'fraction_non_alphanumeric': 0.1270874610812341, 'fraction_numerical': 0.0011321822813472968, 'mean_word_length': 1.3265306122448979, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6470595', 'n_tokens_mistral': 1006, 'n_tokens_neox': 947, 'n_words': 273}