Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: formatting options to list command #238

Merged
merged 2 commits into from
May 25, 2021

Conversation

dinhtungdu
Copy link
Collaborator

@dinhtungdu dinhtungdu commented Mar 30, 2021

In this PR I use WP_CLI\Formatter instead of cli\Table to display the output of list command. This unlocks many display functionalities supported by WP_CLI\Formatter out of the box. See the new help text for the command below.

Fixes #237

  wp safe-redirect-manager list [--field=<field>] [--fields=<field1,field2>] [--format=<format>] [--show_total=<bool>]

  Available fields: 'ID', 'redirect_from', 'redirect_to', 'status_code', 'enable_regex', 'post_status'.

  [--field=<field>]
    Single field to dipslay, should be one of available fields.

  [--fields=<field1,field2>]
    Multiple fields to dipslay, should be a list of available fields.

  [--format=<format>]
    The command output format. Can be table, json, csv, yaml. Default to table.

  [--show_total=<bool>]
    Show total redirects. Default to true.

@jeffpaul jeffpaul added this to the 1.10.1 milestone Apr 21, 2021
@jeffpaul
Copy link
Member

@TheLastCicada any feedback on review of this PR that addresses your related issue?

@jeffpaul jeffpaul added the type:enhancement New feature or request. label Apr 21, 2021
@jeffpaul jeffpaul requested a review from dkotter May 10, 2021 15:30
@jeffpaul jeffpaul merged commit 28647b6 into develop May 25, 2021
@jeffpaul jeffpaul deleted the feature/update-list-command branch May 25, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add formatting options to wp safe-redirect-manager list command
3 participants