@@ 243-245 (lines=3) @@ | ||
240 | */ |
|
241 | public function reset( $args, $assoc_args ) { |
|
242 | $action = isset( $args[0] ) ? $args[0] : 'prompt'; |
|
243 | if ( ! in_array( $action, array( 'options', 'modules' ) ) ) { |
|
244 | /* translators: %s is a command like "prompt" */ |
|
245 | WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) ); |
|
246 | } |
|
247 | ||
248 | // Are you sure? |
|
@@ 544-546 (lines=3) @@ | ||
541 | // Is the option flagged as unsafe? |
|
542 | $flagged = ! in_array( $args[1], $safe_to_modify ); |
|
543 | ||
544 | if ( ! in_array( $action, array( 'list', 'get', 'delete', 'update' ) ) ) { |
|
545 | /* translators: %s is a command like "prompt" */ |
|
546 | WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) ); |
|
547 | } |
|
548 | ||
549 | if ( isset( $args[0] ) ) { |
|
@@ 327-330 (lines=4) @@ | ||
324 | */ |
|
325 | public function module( $args, $assoc_args ) { |
|
326 | $action = isset( $args[0] ) ? $args[0] : 'list'; |
|
327 | if ( ! in_array( $action, array( 'list', 'activate', 'deactivate', 'toggle' ) ) ) { |
|
328 | /* translators: %s is a command like "prompt" */ |
|
329 | WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) ); |
|
330 | } |
|
331 | if ( in_array( $action, array( 'activate', 'deactivate', 'toggle' ) ) ) { |
|
332 | if ( isset( $args[1] ) ) { |
|
333 | $module_slug = $args[1]; |