Return true if command exists

@param  string  command name
@return bool
@author Dmitry (dio) Levashov
482891
public function commandExists($cmd) {
		return $this->loaded && isset($this->commands[$cmd]) && method_exists($this, $cmd);
	}
1138917
public function compareCommandName($commandName, $search) {
        $commandName = preg_split('/(:|-|_)/', $commandName);
        $search = preg_split('/(:|-|_)/', $search);

        foreach ($search as $index => $searchPart) {
            $stringPart = array_get($commandName, $index);

            if ($stringPart === null) {
                return false;
            }

            if ( ! str_starts_with($stringPart, $searchPart)) {
                return false;
            }
        }

        return true;
    }
642784
public function hasArgument($name) {
        try {
            $argument = $this->getCommand()->findArgument($name);

            return $argument->hasValue();
        } catch (ArgumentNotFoundException $ex) {}

        return false;
    }
402986
public static function exists($name)
    {
        static::isOn(true);

        if (!isset(static::$register[$name])) {
            return false;
        } else {
            $item = static::$register[$name];

            return $item['lifetime'] > time() || $item['lifetime'] == 0;
        }
    }
244291
public function has(string $name): bool
    {
        return isset($this->stack[$this->normalizeName($name)]);
    }
1195566
protected function existsInCondition($name) {
        foreach ($this->conditionColumns as $column) {
            if (0 === strpos($column, $name . '.')) {
                return true;
            }
        }
        return false;
    }
1330385
public function exists($name)
    {
        if (isset($this->extraTemplates[$name])) {
            return true;
        }

        return $this->base->exists($name);
    }
593502
public function exists($name, $data)
    {
        $servers = isset($this->config['servers']) ? $this->config['servers'] : null;

        if ((!$name || ($name && $name !== $data['name'])) &&
            isset($data['name']) && isset($servers[$data['name']])
        ) {
            return true;
        }
    }
416667
protected function _default($name) {
		$commands = [
			['model', $name],
			['controller', $name],
			['test', 'model', $name],
			['test', 'controller', $name]
		];
		foreach ($commands as $args) {
			$command = $this->template = $this->request->params['command'] = array_shift($args);
			$this->request->params['action'] = array_shift($args);
			$this->request->params['args'] = $args;

			if (!$this->_execute($command)) {
				return false;
			}
		}
		return true;
	}
192056
public function exists(string $name): bool
    {
        $this->autoload();

        return \array_key_exists($name, $this->env);
    }
456638
public function getCommand($name = null)
    {
        if ($name !== null) {
            return isset($this->commands[$name]) ? $this->commands[$name] : null;
        }

        return $this->command;
    }
80003
public function isExists($name)
    {
        try {
            $this->getQueueId($name);
            $result = true;
        } catch (RuntimeException $e) {
            $result = false;
        }

        return $result;
    }
461939
public function has($name): bool
	{
		return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]);
	}
1226528
public function has($name)
    {
        if (! isset($this->instances[$name])) {
            return isset($this->registry[$name]);
        }

        return true;
    }
273585
private function checkExistenceWithCommand(CommandInterface $command)
    {
        try {
            $this->execute($command);
            return true;
        } catch (S3Exception $e) {
            if ($e->getAwsErrorCode() == 'AccessDenied') {
                return true;
            }
            if ($e->getStatusCode() >= 500) {
                throw $e;
            }
            return false;
        }
    }
976268
protected boolean isValidCommandName(String name) {
        if (Strings.isNullOrBlank(name) || ignoreCommands.contains(name)) {
            return false;
        }
        for (String prefix : ignoreCommandPrefixes) {
            if (name.startsWith(prefix)) {
                return false;
            }
        }
        return true;
    }
108566
public static function validateCommandName($name)
    {
        $name = trim($name);

        if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) {
            throw new \InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name));
        }

        return $name;
    }