get server address from a variable #190
Labels
No Label
breaking-change
bug
CI/CD
design
documentation
duplicate
enhancement
help wanted
invalid
plugin
question
secrets
shell-completion
versioning
wontfix
No Milestone
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/abra#190
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is not a critical feature but it would be very convenient if you didn't have to type the full domain name(s) every time you want to do something on a server. Instead we could use a variable ($ABRA_HOSTS for instance) so if you are planning on runnning more than one command you can just export the hostname to this variable and voila you just saved yourself some typing.
Nice, yep. Flying by but we do have some completion stuff for this:
I don't personally use it as I tried one time and then rage quit trying to set it up but a lot of good work has been done by @3wordchant so I really want to try it again.
Been thinking about this a bit lately...
Yep @knoflook I use the completion;
abra a<TAB> bu<TAB>
gives meabra app butt_autonomic_zone
.To do that, I have
source /path/to/abra/completion/abra.bash
in my~/.bashrc
.ZSH completion was also working for me last time I tried it, not for @decentral1se though, yeah 😢
Back on the idea in this ticket – currently we're using
docopt.sh
for our command-line arguments, and I feel like making<app>
optional for all the commands might be kinda confusing.. but maybe it's worth it for the convenience of that feature? Or maybe there's another way to handle subcommand-parsing?Easiest thing I can think of would be to check the contents of said variable when the command lacks the
<app>
argument. Then we can just put this info in the help section and not change a lot.@knoflook if you don't provide the
<app>
argument currently then it'll just show the help message:This behaviour comes from
docopt.sh
, so if we wanted to make<app>
optional, we'd need to edit the docstring, e.g. changing:abra [options] app <app> config
to
abra [options] app [<app>] config
or adding another line like:
abra [options] app config
I'd be down if anyone wanted to try that out, I'd be a bit nervous about collisions between commands, because the way we map subcommands to functions is tremendously hairy and fragile, but maybe it's fine!
Alternatively, we could maybe support
-
orENV
or something as a special<app>
value, which means "read it from env var". I don't think I've ever seen an app do this, so I'm not sure what conventions, if any, exist for the naming 🤔