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

[Console] Add an hidden grep command #54368

Closed
lyrixx opened this issue Mar 21, 2024 · 5 comments
Closed

[Console] Add an hidden grep command #54368

lyrixx opened this issue Mar 21, 2024 · 5 comments

Comments

@lyrixx
Copy link
Member

lyrixx commented Mar 21, 2024

Description

I run very often bin/console | grep XXXX.
And I just thought, what about a builtin grep command?

bin/console grep XXXX
  • The output would be more beautiful,
  • We could display namespace
  • I save 3 chars each time I need to search a command
  • We could propose to run the command I
  • We could search in hidden command too
  • => Better DX

Example

Before:

$ bin/console | grep cache
 cache
  cache:clear                             Clear the cache
  cache:pool:clear                        Clear cache pools
  cache:pool:delete                       Delete an item from a cache pool
  cache:pool:list                         List available cache pools
  cache:pool:prune                        Prune cache pools
  cache:warmup                            Warm up an empty cache
  doctrine:cache:clear-collection-region  Clear a second-level cache collection region
  doctrine:cache:clear-entity-region      Clear a second-level cache entity region
  doctrine:cache:clear-metadata           Clears all metadata cache for an entity manager
  doctrine:cache:clear-query              Clears all query cache for an entity manager
  doctrine:cache:clear-query-region       Clear a second-level cache query region
  doctrine:cache:clear-result             Clears result cache for an entity manager

After

 cache
  cache:clear                             Clear the cache
  cache:pool:clear                        Clear cache pools
  cache:pool:delete                       Delete an item from a cache pool
  cache:pool:list                         List available cache pools
  cache:pool:prune                        Prune cache pools
  cache:warmup                            Warm up an empty cache
 doctrine
  doctrine:cache:clear-collection-region  Clear a second-level cache collection region
  doctrine:cache:clear-entity-region      Clear a second-level cache entity region
  doctrine:cache:clear-metadata           Clears all metadata cache for an entity manager
  doctrine:cache:clear-query              Clears all query cache for an entity manager
  doctrine:cache:clear-query-region       Clear a second-level cache query region
  doctrine:cache:clear-result             Clears result cache for an entity manager

Another examples:
image

@GromNaN
Copy link
Member

GromNaN commented Mar 21, 2024

Why do you use bin/console | grep XXX? If you look for a command name, console completion with fish is awesome.

@lyrixx
Copy link
Member Author

lyrixx commented Mar 21, 2024

  1. I don't use fish
  2. Completion in bash only search with the beginning of the command.

@kaznovac
Copy link
Contributor

An optional parametar to the list action would be more discoverable

@derrabus
Copy link
Member

I don't think we need this. If you want to save keystrokes, your favorite shell (yes, even bash) allows you to create aliases.

@lyrixx
Copy link
Member Author

lyrixx commented Mar 24, 2024

It's not only about saving keystroke. It more about having a more beautiful output.

But it's not a big deal. Let's close this one. It was juste a random idea.

I may open a PR to add an option to the list command - as suggested by @kaznovac

@lyrixx lyrixx closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2024
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

6 participants