Show an error if a unknown command was called
@param {Object} parameters - the parameters provided in the command and in the prompt
@returns {void} - the execution stops here
165697
function executeCommand(parameters) {
    let msg = '\n  ' + icli.format.ko('Unknown command \n\n');
    msg += '  Enter ' + icli.format.cmd('myrmex -h') + ' to see available commands\n';
    msg += '  You have to be in the root folder of your Myrmex project to see commands implemented by Myrmex plugins\n';
    console.log(msg);
    process.exit(1);
  }
74538
function checkCommand (command, errorCallback) {
    var exec = command
    var args = this.argsExecutable
    var shell = false
    if (this.win) {
      // Arguments have to be manually quoted
      exec = `"${exec}"`
      args = args.map(a => `"${a}"`)
      shell = true
    }

    this.log.verbose(`- executing "${command}" to get executable path`)
    this.run(exec, args, shell, function (err, execPath) {
      // Possible outcomes:
      // - Error: not in PATH, not executable or execution fails
      // - Gibberish: the next command to check version will fail
      // - Absolute path to executable
      if (err) {
        this.addLog(`- "${command}" is not in PATH or produced an error`)
        return errorCallback(err)
      }
      this.addLog(`- executable path is "${execPath}"`)
      this.checkExecPath(execPath, errorCallback)
    }.bind(this))
  }
114715
function (cmd, callback) {
    if (!cmd || !_.isObject(cmd)) {
      debug(err);
      return callback(new Error('Please pass a valid command!'), null);
    }
    return this.aggregate.validateCommand(cmd, callback);
  }
578407
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  if(args[0]) {
    var arg = ('' + args[0]).toLowerCase();
    if(arg !== Constants.SHUTDOWN.SAVE && arg !== Constants.SHUTDOWN.NOSAVE) {
      throw CommandSyntax;
    }

    // rewrite with boolean
    args[0] = (arg === Constants.SHUTDOWN.SAVE);
  }
}
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();
    }
108682
function(name) {
            if (!name) return null;

            name = name.toLowerCase();

            var cmdArgs = [].slice.call(arguments, 1),
                cmd, stoped, result, eventParams;
            var me = this;
            cmd = this._getCommand(name);

            eventParams = {
                command: cmd,
                commandName: name.toLowerCase(),
                commandArgs: cmdArgs
            };
            if (!cmd || !~this.queryCommandState(name)) {
                return false;
            }

            if (!this._hasEnterExecCommand) {
                this._hasEnterExecCommand = true;

                stoped = this._fire(new MinderEvent('beforeExecCommand', eventParams, true));

                if (!stoped) {
                    this._fire(new MinderEvent('preExecCommand', eventParams, false));

                    result = cmd.execute.apply(cmd, [me].concat(cmdArgs));

                    this._fire(new MinderEvent('execCommand', eventParams, false));

                    if (cmd.isContentChanged()) {
                        this._firePharse(new MinderEvent('contentchange'));
                    }

                    this._interactChange();
                }
                this._hasEnterExecCommand = false;
            } else {
                result = cmd.execute.apply(cmd, [me].concat(cmdArgs));

                if (!this._hasEnterExecCommand) {
                    this._interactChange();
                }
            }

            return result === undefined ? null : result;
        }
1265622
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  var value = parseInt('' + args[2]);
  if(value !== 0 && value !== 1) throw InvalidBit;
  args[2] = value;
}
899863
function check_input(input, message) {
  if (!input) {
    error('\n  Error: ' + message);
    program.outputHelp(colors.red);
    process.exit(1);
  }
}
189197
def error(self, argparser, target, message):
        

        warnings.warn(
            'Runtime.error is deprecated and will be removed by calmjs-4.0.0',
            DeprecationWarning)
        details = self.get_argparser_details(argparser)
        argparser = details.subparsers[target] if details else self.argparser
        argparser.error(message)
1090375
function defaultCommand() {
    if (keys.length <= 0) {
        throw new Error("Error: there is no command at all!");
    };

    for (var p in commands) {
        if (commands[p]["default"]) {
            return commands[p];
        };
    };

    if (keys["--help"]) {
        return commands["--help"];
    } else {
        return commands[keys[0]];
    };
}
958454
function exitWithError(error) {
    if (error instanceof Error) {
        process.stderr.write(chalk.red(error));
    } else {
        help();
    }
    process.exit(1);
}
331967
function errBox(func, param, msg) {
        var errMsg = "<b>Error in function</b><br/>" + func + "<br/>" +
            "<b>Parameter</b><br/>" + param + "<br/>" +
            "<b>Message</b><br/>" + msg + "<br/><br/>" +
            "<span onmouseover='this.style.cursor=\"hand\";' onmouseout='this.style.cursor=\"inherit\";' style='width=100%;text-align:right;'>Click to continue</span></div>";
        modalBox(errMsg);
    }
24803
function handleError(call, error) {
  var statusMetadata = new Metadata();
  var status = {
    code: constants.status.UNKNOWN,
    details: 'Unknown Error'
  };
  if (error.hasOwnProperty('message')) {
    status.details = error.message;
  }
  if (error.hasOwnProperty('code') && Number.isInteger(error.code)) {
    status.code = error.code;
    if (error.hasOwnProperty('details')) {
      status.details = error.details;
    }
  }
  if (error.hasOwnProperty('metadata')) {
    statusMetadata = error.metadata;
  }
  status.metadata = statusMetadata._getCoreRepresentation();
  var error_batch = {};
  if (!call.metadataSent) {
    error_batch[grpc.opType.SEND_INITIAL_METADATA] =
        (new Metadata())._getCoreRepresentation();
  }
  error_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = status;
  call.startBatch(error_batch, function(){});
}
511470
function onError(reason, commands) {
        if (typeof reason !== 'string' && typeof reason.message === 'string') {
            reason = reason.message;
        }
        return commands._replyFn(`An unexpected error \`${reason}\` occured and your commands could not be processed!`);
    }
1054831
function cmd (action, url, params, fn) {
      var c, f;

      c = {
        cmd: action + ' ' + me._selectedEnv.apiroot + url
      };

      c.params = ('object' === typeof(params)) ? params: {};
      c.params.eventKey = key();
      c.params.sid = sid();

      f = ('function' === typeof(fn)) ? fn: console.log;
      _commandQ['' + c.params.eventKey] = f;

      return JSON.stringify(c);
    }
1012559
def _check_command_parameters(self, **kwargs):
        
        rset = self._meta_data['required_command_parameters']
        check = _missing_required_parameters(rset, **kwargs)
        if check:
            error_message = 'Missing required params: %s' % check
            raise MissingRequiredCommandParameter(error_message)
640008
function (error, response) {
        if (!_.isNull(error)) {
            error = _.createError(error);
        } else if (!_.isNull(response) && (response.status >= 400 || response.status === 0)) {
            error = _.createError(null, response);
            response = null;
        }
        callback(error, response);
    }