Skip to content

Commit e5f9181

Browse files
committed
feat(command): support exit code
1 parent d9357fb commit e5f9181

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Input/Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ protected function defaults(): self
8080
});
8181

8282
// @codeCoverageIgnoreStart
83-
$this->onExit(function () {
84-
exit(0);
83+
$this->onExit(function ($exitCode = 0) {
84+
exit($exitCode);
8585
});
8686
// @codeCoverageIgnoreEnd
8787

@@ -315,7 +315,7 @@ public function showHelp()
315315
->showArgumentsHelp($this->allArguments())
316316
->showOptionsHelp($this->allOptions(), '', 'Legend: <required> [optional]');
317317

318-
return $this->emit('_exit');
318+
return $this->emit('_exit', 0);
319319
}
320320

321321
/**
@@ -327,7 +327,7 @@ public function showVersion()
327327
{
328328
$this->writer()->bold($this->_version, true);
329329

330-
return $this->emit('_exit');
330+
return $this->emit('_exit', 0);
331331
}
332332

333333
/**

0 commit comments

Comments
 (0)