mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-08-20 06:28:26 +08:00
GH#36 Corrected argument sequence and updated documentation
This commit is contained in:
parent
60bd8d5cd0
commit
bd0543ccd6
2 changed files with 32 additions and 9 deletions
|
@ -72,7 +72,13 @@ class Command {
|
||||||
* : Render output in a particular format.
|
* : Render output in a particular format.
|
||||||
*
|
*
|
||||||
* [--order=<order>]
|
* [--order=<order>]
|
||||||
* : Ascending or Descending order. ASC|DESC.
|
* : Ascending or Descending order.
|
||||||
|
* ---
|
||||||
|
* default: ASC
|
||||||
|
* options:
|
||||||
|
* - ASC
|
||||||
|
* - DESC
|
||||||
|
* ---
|
||||||
*
|
*
|
||||||
* [--orderby=<orderby>]
|
* [--orderby=<orderby>]
|
||||||
* : Order by fields.
|
* : Order by fields.
|
||||||
|
@ -143,7 +149,7 @@ class Command {
|
||||||
$loggers = self::shine_spotlight( $loggers, $metrics );
|
$loggers = self::shine_spotlight( $loggers, $metrics );
|
||||||
}
|
}
|
||||||
|
|
||||||
$formatter->display_items( $order, $orderby, $loggers );
|
$formatter->display_items( $loggers, true, $order, $orderby );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -173,12 +179,17 @@ class Command {
|
||||||
* : Render output in a particular format.
|
* : Render output in a particular format.
|
||||||
*
|
*
|
||||||
* [--order=<order>]
|
* [--order=<order>]
|
||||||
* : Ascending or Descending order. ASC|DESC.
|
* : Ascending or Descending order.
|
||||||
|
* ---
|
||||||
|
* default: ASC
|
||||||
|
* options:
|
||||||
|
* - ASC
|
||||||
|
* - DESC
|
||||||
|
* ---
|
||||||
*
|
*
|
||||||
* [--orderby=<orderby>]
|
* [--orderby=<orderby>]
|
||||||
* : Order by fields.
|
* : Order by fields.
|
||||||
*
|
*
|
||||||
* ---
|
|
||||||
* default: table
|
* default: table
|
||||||
* options:
|
* options:
|
||||||
* - table
|
* - table
|
||||||
|
@ -227,7 +238,7 @@ class Command {
|
||||||
if ( Utils\get_flag_value( $assoc_args, 'spotlight' ) ) {
|
if ( Utils\get_flag_value( $assoc_args, 'spotlight' ) ) {
|
||||||
$loggers = self::shine_spotlight( $loggers, $metrics );
|
$loggers = self::shine_spotlight( $loggers, $metrics );
|
||||||
}
|
}
|
||||||
$formatter->display_items( $order, $orderby, $loggers );
|
$formatter->display_items( $loggers, true, $order, $orderby );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -252,7 +263,13 @@ class Command {
|
||||||
* : Render output in a particular format.
|
* : Render output in a particular format.
|
||||||
*
|
*
|
||||||
* [--order=<order>]
|
* [--order=<order>]
|
||||||
* : Ascending or Descending order. ASC|DESC.
|
* : Ascending or Descending order.
|
||||||
|
* ---
|
||||||
|
* default: ASC
|
||||||
|
* options:
|
||||||
|
* - ASC
|
||||||
|
* - DESC
|
||||||
|
* ---
|
||||||
*
|
*
|
||||||
* [--orderby=<orderby>]
|
* [--orderby=<orderby>]
|
||||||
* : Order by fields.
|
* : Order by fields.
|
||||||
|
@ -301,7 +318,13 @@ class Command {
|
||||||
* : Render output in a particular format.
|
* : Render output in a particular format.
|
||||||
*
|
*
|
||||||
* [--order=<order>]
|
* [--order=<order>]
|
||||||
* : Ascending or Descending order. ASC|DESC.
|
* : Ascending or Descending order.
|
||||||
|
* ---
|
||||||
|
* default: ASC
|
||||||
|
* options:
|
||||||
|
* - ASC
|
||||||
|
* - DESC
|
||||||
|
* ---
|
||||||
*
|
*
|
||||||
* [--orderby=<orderby>]
|
* [--orderby=<orderby>]
|
||||||
* : Order by fields.
|
* : Order by fields.
|
||||||
|
@ -373,7 +396,7 @@ class Command {
|
||||||
'request_count',
|
'request_count',
|
||||||
) );
|
) );
|
||||||
$formatter = new Formatter( $assoc_args, $fields );
|
$formatter = new Formatter( $assoc_args, $fields );
|
||||||
$formatter->display_items( $order, $orderby, $loggers, false );
|
$formatter->display_items( $loggers, false, $order, $orderby );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Formatter {
|
||||||
*
|
*
|
||||||
* @param array $items
|
* @param array $items
|
||||||
*/
|
*/
|
||||||
public function display_items( $order, $orderby, $items, $include_total = true ) {
|
public function display_items( $items, $include_total = true, $order, $orderby ) {
|
||||||
if ( 'table' === $this->args['format'] && empty( $this->args['field'] ) ) {
|
if ( 'table' === $this->args['format'] && empty( $this->args['field'] ) ) {
|
||||||
$this->show_table( $order, $orderby, $items, $this->args['fields'], $include_total );
|
$this->show_table( $order, $orderby, $items, $this->args['fields'], $include_total );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue