register the command

@param string $command
@param string $base
@return $this
776384
public function setCommand($command, $base = null)
    {

        $base = ($base === null) ? BASE : $base;

        parent::setCommand($this->resolveBase($base).'anonym '.$command);
        return $this;
    }
918022
public function registerCommand($commandClass)
    {
        $command = $this->container->make($commandClass);

        $command->setContainer($this->container);

        return $this->symfony->add($command);
    }
1204854
public function registerRootCommand()
	{
		$this->rootCommand = new RootCommand(null, $this->input, $this->output);

		$this->rootCommand->setApplication($this)
			->addCommand(new HelpCommand);

		return $this;
	}
811219
public function registerCommand($command, $callable, array $options = [])
    {
        if (array_key_exists($command, $this->commands)) {
            throw new \Exception("A command with the name {$command} already exists.");
        }

        list($commandInstance, $options) = $this->buildCommand($command, $callable, $options);
        $this->commands[$command]        = $commandInstance;

        foreach ($options['aliases'] as $alias) {
            $this->addCommandAlias($alias, $command);
        }

        return $commandInstance;
    }
209732
public function setCommand($command)
    {
        if (!is_string($command)) {
            throw new InvalidArgumentException('string', 0);
        }
        // escape command
        $this->command = ($this->flags & ESCAPE) ? escapeshellcmd($command) : $command;

        return $this;
    }
1123765
protected function registerMakePolicyCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Generators\Commands\PolicyMakeCommand($app);
        });
    }
702697
protected function registerCommands(array $commands)
	{
		if (!$this->app->runningInConsole()) {
			return;
		}

		foreach ($commands as $key => $command) {
			if (is_numeric($key)) {
				$key = Str::lower(str_replace("\\", '.', $command));
			}

			$method = "register{$command}";

			try {
				if (method_exists($this, $method)) {
					call_user_func_array([$this, $method], [$key]);
				} else {
					$this->app->singleton($key, function ($app) use ($command) {
						return $app->make($command);
					});
				}
				$this->commands($key);
			} catch (\Exception $e) {
				throw $e;
			}
		}
	}
140824
protected function registerCommands(array $commands)
    {
        foreach (array_keys($commands) as $command) {
            call_user_func([$this, "register{$command}Command"]);
        }

        $this->commands(array_values($commands));
    }
152955
protected function addConsoleCommand(Command $command)
    {
        Deprecated::method(3.0, 'registerNutCommands');

        $app = $this->getContainer();
        $app['nut.commands.add']($command);
    }
1169859
public static function register($command, $callback)
    {
        if (!is_string($command) || strlen($command) < 1) {
            throw new BadMethodCallException('Parameter command is not a valid string');
        }
        if (!is_callable($callback)) {
            throw new BadMethodCallException('Parameter callback is not a valid callback');
        }

        $instance = self::getInstance();
        
        $instance->commands[$command] = $callback;
        
        return $instance;
    }
128056
protected function registerMakeCommandCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Generators\Commands\CommandMakeCommand($app);
        });
    }
421759
public function add(SymfonyCommand $command)
    {
        if ($command instanceof Command) {
            $command->setContainer($this->container);
        }

        return $this->addToParent($command);
    }
243925
protected function registerCommand($binding, $command)
    {
        $class = $this->namespace . '\\' . $command . 'Command';
        if (! class_exists($class)) {
            throw new ErrorException("Your ConsoleServiceProvider(AbstractConsoleProvider)->registerCommand($command, $binding) could not find $class");
        }
        $this->app->singleton($binding, $class);
    }
562498
public function resolve($command)
    {
        $commandInstance = $this->di->get($command);

        return $this->add($commandInstance);
    }
204205
public function setDefaultCommand(\Parable\Console\Command $command)
    {
        $this->addCommand($command);
        $this->setDefaultCommandByName($command->getName());
        return $this;
    }
280038
protected function registerAddonStatusCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Addons\Commands\AddonStatusCommand($app);
        });
    }
254013
public function add($command)
    {
        if (is_string($command)) {
            $command = new $command($this->container);
        }

        if (!$command instanceof Console\Commands) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Argument 1 passed to %s must be an instance of %s, %s given',
                    __FUNCTION__,
                    Console\Commands::class,
                    get_class($command)
                )
            );
        }

        if (array_key_exists($command->name(), $this->commands)) {
            throw new \RuntimeException(
                sprintf('Command %s already registered', $command->name())
            );
        }

        $this->commands[$command->name()] = $command;

        return $this;
    }