From 97c3449684dd375548b20eda98f383af47f8eb90 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Mon, 11 Dec 2017 05:59:38 -0800 Subject: [PATCH] Fix location of `--format=` YAML docs --- README.md | 56 +++++++++++++++++++++++++++++++++--- inc/class-command.php | 67 +++++++++++++++++++++---------------------- 2 files changed, 84 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 8ff920a..8fff925 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ This package implements the following commands: Profile each stage of the WordPress load process (bootstrap, main_query, template). ~~~ -wp profile stage [] [--all] [--spotlight] [--url=] [--fields=] [--format=] +wp profile stage [] [--all] [--spotlight] [--url=] [--fields=] [--format=] [--order=] [--orderby=] ~~~ When WordPress handles a request from a browser, it’s essentially @@ -96,6 +96,18 @@ $ wp profile stage bootstrap --fields=hook,time,cache_ratio --spotlight - csv --- + [--order=] + Ascending or Descending order. + --- + default: ASC + options: + - ASC + - DESC + --- + + [--orderby=] + Order by fields. + ### wp profile hook @@ -103,7 +115,7 @@ $ wp profile stage bootstrap --fields=hook,time,cache_ratio --spotlight Profile key metrics for WordPress hooks (actions and filters). ~~~ -wp profile hook [] [--all] [--spotlight] [--url=] [--fields=] [--format=] +wp profile hook [] [--all] [--spotlight] [--url=] [--fields=] [--format=] [--order=] [--orderby=] ~~~ In order to profile callbacks on a specific hook, the action or filter @@ -137,6 +149,18 @@ will need to execute during the course of the request. - csv --- + [--order=] + Ascending or Descending order. + --- + default: ASC + options: + - ASC + - DESC + --- + + [--orderby=] + Order by fields. + ### wp profile eval @@ -144,7 +168,7 @@ will need to execute during the course of the request. Profile arbitrary code execution. ~~~ -wp profile eval [--hook[=]] [--fields=] [--format=] +wp profile eval [--hook[=]] [--fields=] [--format=] [--order=] [--orderby=] ~~~ Code execution happens after WordPress has loaded entirely, which means @@ -173,6 +197,18 @@ current theme. - csv --- + [--order=] + Ascending or Descending order. + --- + default: ASC + options: + - ASC + - DESC + --- + + [--orderby=] + Order by fields. + ### wp profile eval-file @@ -180,7 +216,7 @@ current theme. Profile execution of an arbitrary file. ~~~ -wp profile eval-file [--hook[=]] [--fields=] [--format=] +wp profile eval-file [--hook[=]] [--fields=] [--format=] [--order=] [--orderby=] ~~~ File execution happens after WordPress has loaded entirely, which means @@ -209,6 +245,18 @@ current theme. - csv --- + [--order=] + Ascending or Descending order. + --- + default: ASC + options: + - ASC + - DESC + --- + + [--orderby=] + Order by fields. + ## Installing Installing this package requires WP-CLI's latest stable release. Update to the latest stable release with `wp cli update`. diff --git a/inc/class-command.php b/inc/class-command.php index 9f2e316..29c12d1 100644 --- a/inc/class-command.php +++ b/inc/class-command.php @@ -70,6 +70,14 @@ class Command { * * [--format=] * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - yaml + * - csv + * --- * * [--order=] * : Ascending or Descending order. @@ -83,15 +91,6 @@ class Command { * [--orderby=] * : Order by fields. * - * --- - * default: table - * options: - * - table - * - json - * - yaml - * - csv - * --- - * * @when before_wp_load */ public function stage( $args, $assoc_args ) { @@ -177,6 +176,14 @@ class Command { * * [--format=] * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - yaml + * - csv + * --- * * [--order=] * : Ascending or Descending order. @@ -190,14 +197,6 @@ class Command { * [--orderby=] * : Order by fields. * - * default: table - * options: - * - table - * - json - * - yaml - * - csv - * --- - * * @when before_wp_load */ public function hook( $args, $assoc_args ) { @@ -261,6 +260,14 @@ class Command { * * [--format=] * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - yaml + * - csv + * --- * * [--order=] * : Ascending or Descending order. @@ -274,15 +281,6 @@ class Command { * [--orderby=] * : Order by fields. * - * --- - * default: table - * options: - * - table - * - json - * - yaml - * - csv - * --- - * * @subcommand eval */ public function eval_( $args, $assoc_args ) { @@ -316,6 +314,14 @@ class Command { * * [--format=] * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - yaml + * - csv + * --- * * [--order=] * : Ascending or Descending order. @@ -329,15 +335,6 @@ class Command { * [--orderby=] * : Order by fields. * - * --- - * default: table - * options: - * - table - * - json - * - yaml - * - csv - * --- - * * @subcommand eval-file */ public function eval_file( $args, $assoc_args ) {