webmozart / console

A usable, beautiful and easily testable console toolkit written in PHP.
MIT License
214 stars 58 forks source link

How to set default command? #25

Open leonardovilarinho opened 7 years ago

leonardovilarinho commented 7 years ago

Hi, thanks for the library!

I have a program with the run command, how to set it as the default command?

My code:

$this->beginCommand('run')
                ->markDefault()
                ->setDescription('Run analizer metrics')
                ->setHandler(new \Insphptor\Program\Commands\RunCommand())
                ->beginSubCommand('export')
                    ->setHandlerMethod('export')
                    ->setDescription('Export result in ' . config()['export'] . ' file')
                    ->addArgument('view', Argument::OPTIONAL, 'The view system', 'default')
                    ->addOption('open', 'o', Option::BOOLEAN, 'Open server with result in view')
                ->end()
        ->end();

The markDefault no work, has alternative for it?

MCStreetguy commented 6 years ago

I currently have the same problem. I would really appreciate a solution.