Skip to content

Commit c76e28e

Browse files
authored
Merge pull request #92 from alexjeen/patch-1
Update README.md
2 parents 25b5a93 + 50a168b commit c76e28e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class InitCommand extends Ahc\Cli\Input\Command
185185
}
186186

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

217217
class OtherCommand extends Ahc\Cli\Input\Command
218218
{
219-
// ...
219+
public function __construct()
220+
{
221+
parent::__construct('other', 'Other something');
222+
}
223+
224+
public function execute()
225+
{
226+
$io = $this->app()->io();
227+
228+
$io->write('Other command');
229+
230+
// more codes ...
231+
232+
// If you return integer from here, that will be taken as exit error code
233+
}
220234
}
221235

222236
// Init App with name and version

0 commit comments

Comments
 (0)