[Feature] [ActionPack] Proposal to support column filter for rails routes output on CLI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Feature] [ActionPack] Proposal to support column filter for rails routes output on CLI

Tushar Maroo
Hi All,

The thing which I often use on my CLI is rails routes 

I either use grep to filter out a specific route I want or I use controller level filtering using rails routes -c InboundEmails

But I and some of my friends struggled to see output clearly, as there are just too many columns, long routes, and such a small screen. (I am talking about a regular laptop) 

The regular output looks like:

Prefix | Verb | URI | Controller#Action

And there is no direct option for column level filtering, So either some of us reduce fonts or use awk type things and using a shell script/shortcut to reduce the output.

I would prefer having a clean approach wherein we can pass arguments to rails routes command something like bundle exec rails routes -c InboundEmails -f verb,path,reqs

And the out will look like:

Verb | URI | Controller#Action

It will easily filter out the columns If someone doesn't need it, no need to use awk things anymore.

Also, it would be an optional use case so other people who are happy about the current approach don't see a change and developer experience remains the same.

Let me know what you think. I can quickly put up a working code for the same.

Note:
  • I am proposing this only for Command-Line.
  • I need a better alias than -f, so all suggestions are welcome.

Thanks.
Tushar

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/57f561de-caa4-4dab-a01c-1a1bf0392735%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature] [ActionPack] Proposal to support column filter for rails routes output on CLI

Tushar Maroo
Hi Again,

What do you guys think? If all are okay then let me know I will work on a PR.

Thanks & Regards,
Tushar Maroo


On Sun, Dec 1, 2019 at 6:09 PM Tushar Maroo <[hidden email]> wrote:
Hi All,

The thing which I often use on my CLI is rails routes 

I either use grep to filter out a specific route I want or I use controller level filtering using rails routes -c InboundEmails

But I and some of my friends struggled to see output clearly, as there are just too many columns, long routes, and such a small screen. (I am talking about a regular laptop) 

The regular output looks like:

Prefix | Verb | URI | Controller#Action

And there is no direct option for column level filtering, So either some of us reduce fonts or use awk type things and using a shell script/shortcut to reduce the output.

I would prefer having a clean approach wherein we can pass arguments to rails routes command something like bundle exec rails routes -c InboundEmails -f verb,path,reqs

And the out will look like:

Verb | URI | Controller#Action

It will easily filter out the columns If someone doesn't need it, no need to use awk things anymore.

Also, it would be an optional use case so other people who are happy about the current approach don't see a change and developer experience remains the same.

Let me know what you think. I can quickly put up a working code for the same.

Note:
  • I am proposing this only for Command-Line.
  • I need a better alias than -f, so all suggestions are welcome.

Thanks.
Tushar

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-core/j1IgbAWuFmY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/57f561de-caa4-4dab-a01c-1a1bf0392735%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/CAHG6SBTTvPjVALuXuXT3xZwSNCN6i9FKMrY5oFCzgPquz%3DH9gg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature] [ActionPack] Proposal to support column filter for rails routes output on CLI

Kasper Timm Hansen
We added —expanded to help with the longer lines. You’d have to scroll more, but with a tighter grep I think it could work.

--
Kasper

On 9 Dec 2019, at 07.20, Tushar Maroo <[hidden email]> wrote:

Hi Again,

What do you guys think? If all are okay then let me know I will work on a PR.

Thanks & Regards,
Tushar Maroo


On Sun, Dec 1, 2019 at 6:09 PM Tushar Maroo <[hidden email]> wrote:
Hi All,

The thing which I often use on my CLI is rails routes 

I either use grep to filter out a specific route I want or I use controller level filtering using rails routes -c InboundEmails

But I and some of my friends struggled to see output clearly, as there are just too many columns, long routes, and such a small screen. (I am talking about a regular laptop) 

The regular output looks like:

Prefix | Verb | URI | Controller#Action

And there is no direct option for column level filtering, So either some of us reduce fonts or use awk type things and using a shell script/shortcut to reduce the output.

I would prefer having a clean approach wherein we can pass arguments to rails routes command something like bundle exec rails routes -c InboundEmails -f verb,path,reqs

And the out will look like:

Verb | URI | Controller#Action

It will easily filter out the columns If someone doesn't need it, no need to use awk things anymore.

Also, it would be an optional use case so other people who are happy about the current approach don't see a change and developer experience remains the same.

Let me know what you think. I can quickly put up a working code for the same.

Note:
  • I am proposing this only for Command-Line.
  • I need a better alias than -f, so all suggestions are welcome.

Thanks.
Tushar

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-core/j1IgbAWuFmY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/57f561de-caa4-4dab-a01c-1a1bf0392735%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/CAHG6SBTTvPjVALuXuXT3xZwSNCN6i9FKMrY5oFCzgPquz%3DH9gg%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/1C11893B-34F6-4142-97D8-77CD9D872A42%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature] [ActionPack] Proposal to support column filter for rails routes output on CLI

Tushar Maroo
Hi Kasper,

Yes. I agree.

There are multiple options one can use:
- Using grep as you suggested
- Reducing the font size
- Using AWK etc

All the above can be used to achieve it, but the idea is to support it from within the framework, 
it will help reduce the extra effort required by the developer in all these cases.

Thanks & Regards,
Tushar Maroo


On Fri, Dec 13, 2019 at 3:23 AM Kasper Timm Hansen <[hidden email]> wrote:
We added —expanded to help with the longer lines. You’d have to scroll more, but with a tighter grep I think it could work.

--
Kasper

On 9 Dec 2019, at 07.20, Tushar Maroo <[hidden email]> wrote:

Hi Again,

What do you guys think? If all are okay then let me know I will work on a PR.

Thanks & Regards,
Tushar Maroo


On Sun, Dec 1, 2019 at 6:09 PM Tushar Maroo <[hidden email]> wrote:
Hi All,

The thing which I often use on my CLI is rails routes 

I either use grep to filter out a specific route I want or I use controller level filtering using rails routes -c InboundEmails

But I and some of my friends struggled to see output clearly, as there are just too many columns, long routes, and such a small screen. (I am talking about a regular laptop) 

The regular output looks like:

Prefix | Verb | URI | Controller#Action

And there is no direct option for column level filtering, So either some of us reduce fonts or use awk type things and using a shell script/shortcut to reduce the output.

I would prefer having a clean approach wherein we can pass arguments to rails routes command something like bundle exec rails routes -c InboundEmails -f verb,path,reqs

And the out will look like:

Verb | URI | Controller#Action

It will easily filter out the columns If someone doesn't need it, no need to use awk things anymore.

Also, it would be an optional use case so other people who are happy about the current approach don't see a change and developer experience remains the same.

Let me know what you think. I can quickly put up a working code for the same.

Note:
  • I am proposing this only for Command-Line.
  • I need a better alias than -f, so all suggestions are welcome.

Thanks.
Tushar

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-core/j1IgbAWuFmY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/57f561de-caa4-4dab-a01c-1a1bf0392735%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/CAHG6SBTTvPjVALuXuXT3xZwSNCN6i9FKMrY5oFCzgPquz%3DH9gg%40mail.gmail.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-core/j1IgbAWuFmY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/1C11893B-34F6-4142-97D8-77CD9D872A42%40gmail.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/CAHG6SBR%2BjUcpdcLbbpwNzpg2JUXN93T2G-g6xfDrFCmsx9kTgg%40mail.gmail.com.