[Solar-svn] Revision 3217

pmjones at solarphp.com pmjones at solarphp.com
Thu Jun 12 09:45:07 CDT 2008


Solar_Cli_Base and Solar_Controller_Console

Solar_Cli_Base:

* [CHG] Send error output using _errln(), not _outln().

* [CHG] When displaying version, use the vendor name, not hard-coded Solar name.

Solar_Controller_Console:

* [CHG] Sort the command list alphabetically.





Modified: trunk/Solar/Cli/Base.php
===================================================================
--- trunk/Solar/Cli/Base.php	2008-06-12 14:41:01 UTC (rev 3216)
+++ trunk/Solar/Cli/Base.php	2008-06-12 14:45:07 UTC (rev 3217)
@@ -34,8 +34,8 @@
             // we use 'null' command because we could have gotten here from
             // using an option or something else first, and a recognized 
             // command later on.  showing that command here would be confusing.
-            $this->_outln('ERR_UNKNOWN_COMMAND', 1, array('cmd' => null));
-            $this->_outln('HELP_TRY_SOLAR_HELP');
+            $this->_errln('ERR_UNKNOWN_COMMAND', 1, array('cmd' => null));
+            $this->_errln('HELP_TRY_SOLAR_HELP');
         } else {
             $this->_outln($this->getInfoHelp());
         }
@@ -54,10 +54,13 @@
     {
         $skip_exec = false;
         
+        $tmp = explode('_', get_class($this));
+        $vendor = $tmp[0];
+        
         switch (true) {
         
         case $this->_options['version']:
-            $this->_out("Solar command-line tool, version ");
+            $this->_out("$vendor command-line tool, version ");
             $this->_outln($this->apiVersion() . '.');
             $skip_exec = true;
             break;

Modified: trunk/Solar/Controller/Console.php
===================================================================
--- trunk/Solar/Controller/Console.php	2008-06-12 14:41:01 UTC (rev 3216)
+++ trunk/Solar/Controller/Console.php	2008-06-12 14:45:07 UTC (rev 3217)
@@ -208,6 +208,9 @@
     
         // override with explicit routings
         $this->_command_list = array_merge($list, $this->_routing);
+        
+        // sort, and done
+        ksort($this->_command_list);
     }
     
     /**




More information about the Solar-svn mailing list