commando icon indicating copy to clipboard operation
commando copied to clipboard

Add an option to throw an exception or return instead of calling exit()

Open d0x2f opened this issue 7 years ago • 1 comments

Calling exit aborts the entire application making it difficult work around in some situations, such as during unit tests or when the outcome of an invocation should be logged.

An option to throw an exception instead of calling exit would be great!

Relevant line: https://github.com/nategood/commando/blob/7ae153aa211c0686f139062856642e33bf8a86e0/src/Commando/Command.php#L460

d0x2f avatar Oct 03 '18 10:10 d0x2f

See my PHP 7.2+ fork/rewrite, which does neither: https://packagist.org/packages/tolidano/commandox

Happy to discuss further there.

tolidano avatar Jun 02 '19 02:06 tolidano