Command Editor - Show a list of the commands
@param  {Object} config             Current configuration
@return {Promise}
960811
function showCommandsOnCmdEditor (config) {

	console.log(colors.bold('\nAvailable Commands for ' + config.deviceName + ':\n'));

	// Iterate the each commands
	var commands = config.commands || {};
	if (Object.keys(commands).length == 0) {
		console.log ('\nThere is no command.');
	} else {
		for (var name in commands) {
			var desc = commands[name].description || '';
			console.log(colors.bold('\n' + name + '') + '\n  ' + desc + '\n');

			// Iterate the each arguments
			var args = commands[name].args || {};
			if (Object.keys(args).length == 0) {
				console.log ('\tThe arguments of this command are not defined');
			} else {
				for (var arg_name in args) {
					var arg_spec = args[arg_name] || '';
					console.log('\t* ' + arg_name + ' - ' + arg_spec);
				}
			}

		}
	}

	console.log('\n');

	// Done
	return new Promise(function (resolve, reject) {
		resolve();
	});

}
523010
function getCommand(commandName) {
    return _.find(commands, function (command) {
      return _.includes(command.aliases, commandName);
    });
  }
4992
public function dropdown($commands, $config = array())
    {
        $config['commands'] = $commands;

        if (!isset($config['icon'])) {
            $config['icon'] = 'cog';
        }

        return $this->_render('dropdown', $config);
    }
417449
function getCommandNames(cmds) {
  var commands = _.map(cmds, '_name');
  commands = commands.concat.apply(commands, _.map(cmds, '_aliases'));
  commands.sort();
  return commands;
}
1368858
public function createCommand($config = [])
    {
        $this->open();
        $config['db'] = $this;
        $command = new Command($config);

        return $command;
    }
746976
function GetCommandList(execName, packageJson, Commands) {
  const header = `\
${packageJson.title || packageJson.name || execName} ${packageJson.version}
Usage:    ${execName} ${col.bold('<command>')} [options]
Commands:`;

  const grouped = _.groupBy(Commands, 'helpGroup');
  const sorted = _.mapValues(grouped, arr => _.sortBy(arr, 'helpPriority'));
  const sortedGroups = _.sortBy(sorted, grp => grp[0].helpPriority);
  const longestCmd = _.max(_.map(Commands, cmd => cmd.name.length));
  const commandListStr = _.map(sortedGroups, (helpGroup) => {
    const groupName = _.first(helpGroup).helpGroup;
    return _.flatten([
      `\n  * ${col.primary(groupName)}`,
      _.map(helpGroup, (cmd) => {
        const cmdName = _.padEnd(cmd.name, longestCmd);
        return `    ${col.bold(cmdName)} ${cmd.desc}`;
      }),
    ]).join('\n');
  }).join('\n');

  return `\
${header}
${commandListStr}

Use ${col.bold(`${execName} <command> -h`)} for command-specific help.`;
}
215890
function cmdHelp(command) {
        let ext = '';
        if (command.args && command.args.length > 0) {
            ext = command.args.join(' ');
        }
        if (ext && helpTopics[ext]) {
            const txt = `Help topic for \`${ext}\`\n\n${helpTopics[ext]}` +
                '\n\nIssue the `help` command without any parameters to see all available commands';
            command.reply(txt);

        } else {
            const help = `${getCommandHelps()}\n\n\\* Help topic available.\n\nIssue the \`help\` command with an ` +
                'available help topic as a parameter to read additonal help';
            command.reply(help);
        }
        return Promise.resolve();
    }
335480
function runCommand(command, options) {
    let cmd = getCommand(command);
    if (!cmd || command === 'help') {
      cmd = getCommand('help');
    } else {
      try {
        validateConfig(options);
      } catch (error) {
        console.log(error.message);
        process.exit(1);
      }
    }
    let fn = cmd.callback;
    let opts = mapParams(cmd, options);
    fn(opts).then(function (result) {
      if (cmd.formatter) {
        cmd.formatter.format(result.messages, options);
      } else {
        console.log(result);
      }
    }).catch(function (error) {
      let formatter = new formatters.MessageFormatter();
      if (error.response) {
        console.log(error);
        formatter.format(['Error response received: ' + error.response.data.errors[0].message]);
      } else {

        formatter.format([error.message]);
      }
      process.exit(1);
    });
  }
447404
private function cmdJs()
    {
        echo "\n - JS -\n";
        if ($js = $this->config->get('js')) {
            if (!$this->subCmd) {
                foreach ($js as $k => $v) {
                    echo "\n - $k:\n";
                    $this->minify($v->filename, $v->add, $this->yuicompressor, $this->config->baseDir);
                }
                return;
            }

            if (isset($js->{$this->subCmd})) {
                echo "\n - ".$this->subCmd."\n";
                $this->minify($js->{$this->subCmd}->filename,
                  $js->{$this->subCmd}->add,
                  $this->yuicompressor,
                  $this->config->baseDir);
            } else {
                echo "\n Err: Not found!\n";
                return;
            }
        }
    }
297882
function _Overlay_showAndHideFast(showCommands, hideCommands) {
                    var count;
                    var command;
                    for (count = 0; count < showCommands.length; count++) {
                        command = showCommands[count];
                        if (command && command.style) {
                            command.style.visibility = "";
                            command.style.display = "";
                        }
                    }
                    for (count = 0; count < hideCommands.length; count++) {
                        command = hideCommands[count];
                        if (command && command.style) {
                            command.style.visibility = "hidden";
                            command.style.display = "none";
                        }
                    }

                    this._commandsUpdated();

                }
118174
private function loadTools($config)
    {
        if (!isset($config['tools'])) {
            throw new EditorJSException('Tools not found in configuration');
        }

        foreach ($config['tools'] as $toolName => $toolData) {
            if (isset($this->tools[$toolName])) {
                throw new EditorJSException("Duplicate tool $toolName in configuration");
            }

            $this->tools[$toolName] = $this->loadTool($toolData);
        }
    }
1156247
public function dialog($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'command' => NULL
        ));

        $html = $this->command($config);

        return $html;
    }
739719
function formatConfig(config) {
  var result = {
    appenders: {
      out: { type: 'console' }
    },
    categories: {
      default: {
        appenders: ['out'],
        level: 'info'
      }
    }
  };
  var _iteratorNormalCompletion = true;
  var _didIteratorError = false;
  var _iteratorError = undefined;

  try {
    for (var _iterator = config.appenders[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
      var appender = _step.value;

      result.appenders[appender.type] = Object.assign({}, appender);(result.categories[appender.category] || (result.categories[appender.category] = {
        appenders: [],
        level: 'info'
      }))['appenders'].push(appender.type);
    }
  } catch (err) {
    _didIteratorError = true;
    _iteratorError = err;
  } finally {
    try {
      if (!_iteratorNormalCompletion && _iterator.return) {
        _iterator.return();
      }
    } finally {
      if (_didIteratorError) {
        throw _iteratorError;
      }
    }
  }

  return result;
}
1159896
function (config, event) {
                return (event.altKey == !!config.alt) && (event.shiftKey == !!config.shift)
                        && (event.ctrlKey == !!config.ctrl);
            }
27598
function run(command) {
  const script = findScript(command);
  const config = findConfig();

  if (!script) {
    console.error(`ERROR: File not found: scripts/${command}.js`);
    process.exit(1);
  }

  const start = new Date();
  console.log(`Starting '${chalk.bold.gray(command)}'...`);

  return Promise.resolve().then(() => require(script)(config)).then(() => {
    console.log(
      `Finished '${chalk.bold.gray(command)}' after ` +
      `${chalk.bold(new Date().getTime() - start.getTime())}ms`
    );
  }, err => console.error(err.stack));
}
960820
function addCommands(commands){
	for(var i in commands){
		var commandObj = commands[i];
		addCommand(commandObj);
	}

	return module.exports;
}
956162
function transformConfig (config) {
	if (config === null || typeof config !== 'object') {
		config = {};
	}

	if (!Object.keys(config).length) {
		return {
			options: {},
			files: {
				ignore: [ignoreNodeModules()]
			}
		};
	}

	let runConfig = {
		options: {
			showMaxStack: 0
		}
	};

	if (config.noDisabling) {
		runConfig.options.noDisabling = true;
	}

	if (config.formatter) {
		runConfig.options.formatter = config.formatter;
	}
	if (config.showMaxStack >= 0) {
		runConfig.options.showMaxStack = config.showMaxStack;
	}
	if (config.outputFile) {
		runConfig.options['output-file'] = config.outputFile;
	}
	if (Array.isArray(config.ignore)) {
		runConfig.files = {
			ignore: config.ignore.concat(ignoreNodeModules())
		};
	} else {
		runConfig.files = {
			ignore: [ignoreNodeModules()]
		};
	}

	return runConfig;
}