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

Option to suppress output? #65

Open
1 task done
edent opened this issue Oct 2, 2023 · 3 comments
Open
1 task done

Option to suppress output? #65

edent opened this issue Oct 2, 2023 · 3 comments

Comments

@edent
Copy link

edent commented Oct 2, 2023

Feature Request

When dealing with complex queries, WP Shell often dumps large volumes of data on to my screen.

For example, running a query with 'posts_per_page'=> 200, will result in hundreds of blog posts being printed. But I only want, say, the GUID.

Describe the solution you'd like

I'd like a command-line option so that wp shell --no-output will only display what I explicitly echo.

Current version:

wp shell
wp> $a = "hello";
=> string(5) "hello"

Proposed version:

wp shell --no-output
wp> $a = "hello";
wp>

@danielbachhuber
Copy link
Member

We could potentially repurpose the --quiet global argument for this.

Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices.

@edent
Copy link
Author

edent commented Oct 11, 2023

Thanks. Am I right in thinking the functionality just needs to be altered in:

if ( ! self::starts_with( 'return', $line ) ) {

@danielbachhuber
Copy link
Member

@edent That might be it!

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

No branches or pull requests

3 participants