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

update wp cli info #4613

Merged
merged 4 commits into from
Feb 15, 2018
Merged

update wp cli info #4613

merged 4 commits into from
Feb 15, 2018

Conversation

thrijith
Copy link
Member

@thrijith thrijith commented Jan 14, 2018

to update #4599
change output format to table : #4604 (comment)

not sure if this is what you expected @gitlost, please provide your inputs for any changes.

change output format to table
fix tests
@schlessera
Copy link
Member

I wonder if people use the output from wp cli info for scripting purposes. If so, the above is a breaking change. I'll ask in #cli to get some (limited) feedback.

@gitlost
Copy link
Contributor

gitlost commented Jan 15, 2018

Yes, apologies for the misleading comment @thrijith, although the output does look a lot better (though could do without the header). Please note this isn't a high priority at the moment so won't be reviewed immediately and may not make 1.5.0.

@thrijith
Copy link
Member Author

ok @schlessera

@thrijith
Copy link
Member Author

no problem @gitlost will remove the header.

@gitlost
Copy link
Contributor

gitlost commented Jan 15, 2018

will remove the header.

@thrijith if instead you have time to investigate wp-cli/scaffold-command#109 and whether the output is compliant in other cases apart from the taxonomy one you fixed that would very much be appreciated!

@thrijith
Copy link
Member Author

ok @gitlost will work on it then

@gitlost
Copy link
Contributor

gitlost commented Jan 25, 2018

@thrijith am going to leave this PR out of 1.5.0 but will revisit shortly afterwards, ta!

@gitlost
Copy link
Contributor

gitlost commented Feb 9, 2018

@thrijith re headerless table, at the moment need to workaround limitations of Utils\format_items(), WP_CLI\Formatter and cli\Table so maybe do

			$table = new \cli\Table;
			$table->setRows( $info );
			$table->setRenderer( new \cli\table\Ascii );
			$lines = array_slice( $table->getDisplayLines(), 2 ); // Remove header and border.
			foreach ( $lines as $line ) {
				\WP_CLI::line( $line );
			}

@schlessera schlessera requested a review from a team February 9, 2018 19:50
Copy link
Contributor

@gitlost gitlost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sticking with this @thrijith ! Although technically a BC break I think anyone who is parsing this is hopefully using the json format.

(One would have to agree with code climate though that this function could do with a bit of a refactor - the json and table paths should share and return the same data (with different keys) for instance. Also getting the shell should probably be put in a new Utils function. But these are for another day!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants