Permalink
Browse files

Force Command to parse the arguments

Useful for showing the --help response even when no argument is
requested.
  • Loading branch information...
1 parent 8b9f5d9 commit 738fc3e3bf6f7b47a5d8a01949c5d65fc2ee8c0a @felds felds committed Jan 8, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/Commando/Command.php
View
@@ -86,6 +86,13 @@ public function __construct($tokens = null)
$this->setTokens($tokens);
}
+ public function __destruct()
+ {
+ if (!$this->parsed) {
+ $this->parse();
+ }
+ }
+
/**
* Factory style reads a little nicer
* @param array $tokens defaults to $argv

0 comments on commit 738fc3e

Please sign in to comment.