File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -67,4 +67,15 @@ Feature: Runner WP-CLI
6767 Then STDERR should contain:
6868 """
6969 The --path parameter cannot be empty when provided
70- """
70+ """
71+
72+ Scenario : Suggest 'meta' when 'option' subcommand is run
73+ Given a WP install
74+
75+ When I try `wp network option`
76+ Then STDERR should contain:
77+ """
78+ Error: 'option' is not a registered subcommand of 'network'. See 'wp help network' for available subcommands.
79+ Did you mean 'meta'?
80+ """
81+ And the return code should be 1
Original file line number Diff line number Diff line change @@ -372,6 +372,11 @@ public function find_command_to_run( $args ) {
372372 $ child = array_pop ( $ cmd_path );
373373 $ parent_name = implode ( ' ' , $ cmd_path );
374374 $ suggestion = $ this ->get_subcommand_suggestion ( $ child , $ command );
375+
376+ if ( 'network ' === $ parent_name && 'option ' === $ child ) {
377+ $ suggestion = 'meta ' ;
378+ }
379+
375380 return sprintf (
376381 "'%s' is not a registered subcommand of '%s'. See 'wp help %s' for available subcommands.%s " ,
377382 $ child ,
You can’t perform that action at this time.
0 commit comments