<commit_before>module.exports = function(cmd, args) {
    //console.log(`$(cmd) $(args)`);
    if(cmd === 'roomPlan') {
        roomPlanCmdHandler(args);
    } else if(cmd === 'reset') {
        resetCmdHandler(args);
    } else {
        notImplemented();
    }
};

function resetCmdHandler(args) {
    if(args && args.length===1) {
        if(args[0]==='force') {
            for(let key in Memory) {
                delete Memory[key];
                console.log('Reset done.');
            }
        }
    } else {
        console.log('This command will reset Memory, use reset force if you are sure about this');
    }
}

function roomPlanCmdHandler(args) {
    //roomPlan on/off
    if(args && args.length===2) {
        const op = args[0];
        const roomName = args[1];
        if(op === 'on') {
            Memory.rooms[roomName].showRoomPlan = true;
        } else if(op === 'off') {
            Memory.rooms[roomName].showRoomPlan = false;
        }
    } else {
        wrongAmountOfArgs();
    }
};

function notImplemented() {
    console.log('command not implemented');
};

function wrongAmountOfArgs() {
    console.log('the amount of argument is not correct');
}
<commit_msg>add command to reinit roomPlan<commit_after>module.exports = function(cmd, args) {
    //console.log(`$(cmd) $(args)`);
    if(cmd === 'roomPlan') {
        roomPlanCmdHandler(args);
    } else if(cmd === 'reset') {
        resetCmdHandler(args);
    } else {
        notImplemented();
    }
};

function resetCmdHandler(args) {
    if(args && args.length===1) {
        if(args[0]==='force') {
            for(let key in Memory) {
                delete Memory[key];
                console.log('Reset done.');
            }
        }
    } else {
        console.log('This command will reset Memory, use reset force if you are sure about this');
    }
}

function roomPlanCmdHandler(args) {
    if(args && args.length===2) {
        const op = args[0];
        const roomName = args[1];
        //roomPlan on/off
        if(op === 'on') {
            Memory.rooms[roomName].showRoomPlan = true;
        } else if(op === 'off') {
            Memory.rooms[roomName].showRoomPlan = false;
        } else if(op === 'reinit') {
            Memory.rooms[roomName].layout.init = false;
        }
    } else {
        wrongAmountOfArgs();
    }
};

function notImplemented() {
    console.log('command not implemented');
};

function wrongAmountOfArgs() {
    console.log('the amount of argument is not correct');
}

{'fraction_non_alphanumeric': 0.15323224261771748, 'fraction_numerical': 0.0039904229848363925, 'mean_word_length': 2.1614123581336697, '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': '3255489', 'n_tokens_mistral': 755, 'n_tokens_neox': 754, 'n_words': 167}