OSDN Git Service

move 'sql' aliasing to Runner
authorscribu <mail@scribu.net>
Sun, 9 Jun 2013 13:40:22 +0000 (16:40 +0300)
committerscribu <mail@scribu.net>
Sun, 9 Jun 2013 13:45:43 +0000 (16:45 +0300)
php/WP_CLI/Dispatcher/RootCommand.php
php/WP_CLI/Runner.php

index 9fc159a..fb9b05d 100644 (file)
@@ -91,13 +91,6 @@ EOB
        function find_subcommand( &$args ) {
                $command = array_shift( $args );
 
-               $aliases = array(
-                       'sql' => 'db'
-               );
-
-               if ( isset( $aliases[ $command ] ) )
-                       $command = $aliases[ $command ];
-
                Utils\load_command( $command );
 
                if ( !isset( $this->subcommands[ $command ] ) ) {
index 621097b..6b17b49 100644 (file)
@@ -223,6 +223,11 @@ class Runner {
                        unset( $assoc_args['help'] );
                }
 
+               // sql  ->  db
+               if ( count( $args ) > 0 && 'sql' == $args[0] ) {
+                       $args[0] = 'db';
+               }
+
                // {plugin|theme} update --all  ->  {plugin|theme} update-all
                if ( count( $args ) > 1 && in_array( $args[0], array( 'plugin', 'theme' ) )
                        && $args[1] == 'update' && isset( $assoc_args['all'] )