thoughtbot / flightctl

A command-line client to interact with Flightdeck clusters and workspaces.
MIT License
6 stars 1 forks source link

Pass additional command line arguments back through to the rails console command? #9

Closed jared-thoughtbot closed 1 year ago

jared-thoughtbot commented 1 year ago

It seems like at some point after Ruby 3, irb enabled autcomplete by default. For our current project, this means remote consoles have this on but it's really slow and gets in the way.

We can add IRB.conf[:USE_AUTOCOMPLETE] = false into ~/.irbrc but this would apply for everyone, everywhere and some users may like it locally. From my research we can pass a --noautocomplete command line option to the rails console command. I thought this would be a nice approach to add this to our bin/aws-console command so that we turn it off for remote consoles but give users the freedom to use irb autocomplete locally if they want.

I've experimented with trying eg. bin/flightctl console -e dev --noautocomplete or bin/flightctl console -e dev -- --noautocomplete but I get error: Found argument '--noautocomplete' which wasn't expected, or isn't valid in this context (I'm not sure what the extra -- does but I saw it in that StackOverflow answer). I'm guessing flightctl doesn't support passing arguments through like this?

This is totally not a high priority but I wondered if something like this would be useful more generally for flightctl?

image

jared-thoughtbot commented 1 year ago

We solved this on our project by introducing a project level .irbc with IRB.conf[:USE_AUTOCOMPLETE] = false. And letting the team know that if they want to override it locally they can create a global ~/.irbc file and setting IRB.conf[:USE_AUTOCOMPLETE] = true (which will override any project specific .irbc file).