Closed cwbeck closed 5 years ago
Sorry if I'm being naive here, but what's the purpose of run? @cwbeck
__destruct() causes errors not to be thrown properly. This allows it to be called directly so errors can be caught. It's a PHP issue.
-1 use parse.
Your try block should not be around the definition of the options. Errors will be thrown when the tokens are parsed. This happens when you access an option key for the first time.
$cmd->option('c');
try {
$cmd['c']; // calls $cmd->parse()
} catch(Exception $e) {
...
}
Added support for run() and created function for terminal errors