Skip to content

Commit

Permalink
Merge pull request #92 from alexjeen/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
adhocore authored Sep 24, 2023
2 parents 25b5a93 + 50a168b commit c76e28e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class InitCommand extends Ahc\Cli\Input\Command
}

// This method is auto called before `self::execute()` and receives `Interactor $io` instance
public function interact(Ahc\Cli\IO\Interactor $io)
public function interact(Ahc\Cli\IO\Interactor $io) : void
{
// Collect missing opts/args
if (!$this->apple) {
Expand Down Expand Up @@ -216,7 +216,21 @@ class InitCommand extends Ahc\Cli\Input\Command

class OtherCommand extends Ahc\Cli\Input\Command
{
// ...
public function __construct()
{
parent::__construct('other', 'Other something');
}

public function execute()
{
$io = $this->app()->io();

$io->write('Other command');

// more codes ...

// If you return integer from here, that will be taken as exit error code
}
}

// Init App with name and version
Expand Down

0 comments on commit c76e28e

Please sign in to comment.