OSDN Git Service

add --basic flag to `wp shell` command
authorscribu <mail@scribu.net>
Wed, 8 May 2013 12:06:46 +0000 (15:06 +0300)
committerscribu <mail@scribu.net>
Wed, 8 May 2013 12:08:49 +0000 (15:08 +0300)
man-src/shell.txt
php/commands/shell.php

index 1759cff..da5393c 100644 (file)
@@ -7,3 +7,9 @@
 You can split a statement over multiple lines by adding a `\` (backslash) before hitting Return.
 
 If you type `history` and hit Return, WP-CLI will print the list of previously evaluated statements, which you can copy+paste into a PHP file.
+
+## OPTIONS
+
+* `--basic`:
+
+       Start in fail-safe mode, even if Boris is available.
index 8ab60c0..4ff4215 100644 (file)
@@ -4,8 +4,10 @@ class Shell_Command extends \WP_CLI_Command {
 
        /**
         * Interactive PHP console.
+        *
+        * @synopsis [--basic]
         */
-       public function __invoke() {
+       public function __invoke( $_, $assoc_args ) {
                \WP_CLI::line( 'Type "exit" to close session.' );
 
                $implementations = array(
@@ -13,6 +15,10 @@ class Shell_Command extends \WP_CLI_Command {
                        '\\WP_CLI\\REPL',
                );
 
+               if ( isset( $assoc_args['basic'] ) ) {
+                       unset( $implementations[0] );
+               }
+
                foreach ( $implementations as $class ) {
                        if ( class_exists( $class ) ) {
                                $repl = new $class( 'wp> ' );