lib/commands.js
function getCommandHelps() {
        const cmds = {},
            topics = {},
            result = ['Registered commands:'];
        let keys = {};
        Object.keys(handlers).map((key) => {
            keys[key] = 1;
        });
        Object.keys(helpTopics).map((key) => {
            keys[key] = 1;
        });
        Object.keys(keys).map((key) => {
            if (handlers[key]) {
                cmds[key] = handlers[key].help;
                if (helpTopics[key]) {
                    cmds[key] += ' *';
                }
            } else {
                topics[key] = 'Extended help topic';
            }
        });
        keys = Object.keys(cmds);
        keys.sort();
        keys.forEach((cmd) => result.push(`${cmd}: ${cmds[cmd]}`));
        keys = Object.keys(topics);
        if (keys.length) {
            result.push('');
            result.push('Help Topics:');
            keys.sort();
            keys.forEach((topic) => result.push(`${topic}: ${topics[topic]}`));
        }
        return result.join('\n');
    }
function getCommandHelps() {
        const cmds = {},
            topics = {},
            result = ['Registered commands:'];
        let keys = {};
        Object.keys(handlers).map((key) => {
            keys[key] = 1;
        });
        Object.keys(helpTopics).map((key) => {
            keys[key] = 1;
        });
        Object.keys(keys).map((key) => {
            if (handlers[key]) {
                cmds[key] = handlers[key].help;
                if (helpTopics[key]) {
                    cmds[key] += ' *';
                }
            } else {
                topics[key] = 'Extended help topic';
            }
        });
        keys = Object.keys(cmds);
        keys.sort();
        keys.forEach((cmd) => result.push(`${cmd}: ${cmds[cmd]}`));
        keys = Object.keys(topics);
        if (keys.length) {
            result.push('');
            result.push('Help Topics:');
            keys.sort();
            keys.forEach((topic) => result.push(`${topic}: ${topics[topic]}`));
        }
        return result.join('\n');
    }
function getCommandHelps ( ) { const cmds = { } , topics = { } , result = [ 'Registered commands:' ] ; let keys = { } ; Object . keys ( handlers ) . map ( ( key ) => { keys [ key ] = 1 ; } ) ; Object . keys ( helpTopics ) . map ( ( key ) => { keys [ key ] = 1 ; } ) ; Object . keys ( keys ) . map ( ( key ) => { if ( handlers [ key ] ) { cmds [ key ] = handlers [ key ] . help ; if ( helpTopics [ key ] ) { cmds [ key ] += ' *' ; } } else { topics [ key ] = 'Extended help topic' ; } } ) ; keys = Object . keys ( cmds ) ; keys . sort ( ) ; keys . forEach ( ( cmd ) => result . push ( ` ${ cmd } ${ cmds [ cmd ] } ` ) ) ; keys = Object . keys ( topics ) ; if ( keys . length ) { result . push ( '' ) ; result . push ( 'Help Topics:' ) ; keys . sort ( ) ; keys . forEach ( ( topic ) => result . push ( ` ${ topic } ${ topics [ topic ] } ` ) ) ; } return result . join ( '\n' ) ; }
Get help text for commands

@private

@returns {string} Command help text
Get help text for commands