Skip to content

update wp cli info#4613

Merged
gitlost merged 4 commits intowp-cli:masterfrom
thrijith:GH-4599-output-format-table
Feb 15, 2018
Merged

update wp cli info#4613
gitlost merged 4 commits intowp-cli:masterfrom
thrijith:GH-4599-output-format-table

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.

@schlessera schlessera added the command:cli-info Related to 'cli info' command label Jan 15, 2018
@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

Labels

breaking-change command:cli-info Related to 'cli info' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants