Shell completion #5

Closed
opened 2020-09-08 15:02:38 +00:00 by 3wordchant · 8 comments
Owner

Maybe overkill depending on how long we think this janky Bash implementation is gonna exist for, but it'd be nice to have completion of commands and their arguments.

Maybe overkill depending on how long we think this janky Bash implementation is gonna exist for, but it'd be nice to have completion of commands and their arguments.
3wordchant added the
enhancement
label 2020-09-13 16:00:22 +00:00
Owner

https://git.autonomic.zone/coop-cloud/abra/src/branch/main/completion.bash

Apparently zsh can also handle, I tried:

➜  abra (main) ✔ autoload bashcompinit; bashcompinit
➜  abra (main) ✔ source completion.bash
➜  abra (main) ✔ ./abra _abra_complete:2: compopt: function definition file not found

This seems to be some sort of incompatibility with versions.

> https://git.autonomic.zone/coop-cloud/abra/src/branch/main/completion.bash Apparently `zsh` can also handle, I tried: ``` ➜ abra (main) ✔ autoload bashcompinit; bashcompinit ➜ abra (main) ✔ source completion.bash ➜ abra (main) ✔ ./abra _abra_complete:2: compopt: function definition file not found ``` This seems to be some sort of incompatibility with versions.
Author
Owner

I re-added some copypasta from homeshick which claims to handle missing compopt, that work any better?

I re-added some copypasta from homeshick which claims to handle missing `compopt`, that work any better?
Owner

Thanks! Still same issue... I guess some further digging is required for Zsh.

Feel free to close this one off on your side for Bash, looks legit :)

Thanks! Still same issue... I guess some further digging is required for Zsh. Feel free to close this one off on your side for Bash, looks legit :)
Author
Owner

Ugh embarrassing copypasta error, forgot to s/HOMESHICK/ABRA in one place. Any joy now? If still no I might install zsh under protest.

Ugh embarrassing copypasta error, forgot to `s/HOMESHICK/ABRA` in one place. Any joy now? If still no I might install `zsh` under protest.
Owner

Oh! But no... haha, sorry!

➜  abra (main) ✔ autoload bashcompinit; bashcompinit
➜  abra (main) ✔ source completion.bash
➜  abra (main) ✔ ./abra _abra_complete:52: command not found: mapfile

I tried https://stackoverflow.com/questions/53975551/how-to-load-zsh-mapfile-in-zsh but then I also saw:

./abra app _abra_apps:4: command not found: shopt

Guess those are Bash only functions or!? Pretty lost with this stuff...

Oh! But no... haha, sorry! ``` ➜ abra (main) ✔ autoload bashcompinit; bashcompinit ➜ abra (main) ✔ source completion.bash ➜ abra (main) ✔ ./abra _abra_complete:52: command not found: mapfile ``` I tried https://stackoverflow.com/questions/53975551/how-to-load-zsh-mapfile-in-zsh but then I also saw: ``` ./abra app _abra_apps:4: command not found: shopt ``` Guess those are Bash only functions or!? Pretty lost with this stuff...
Owner

Lol, ok, using abra more and more (it is awesome) but I can now say that it is maybe not so RSI friendly hehe, many typingz of domain required! Maybe abra app deploy and then selection screen will be good too. Will come back to this...

Lol, ok, using `abra` more and more (it is awesome) but I can now say that it is maybe not so RSI friendly hehe, many typingz of domain required! Maybe `abra app deploy` and then selection screen will be good too. Will come back to this...
Author
Owner

Yeah I had the same hand-health concerns 😬 Both mapfile and shopt are Bash hacks to load things into arrays, I guess zsh has better ones, and writing a separate version of the script might be easier than making the Bash one cross-compatible. I'll give it a go unless you get there first.

Yeah I had the same hand-health concerns 😬 Both `mapfile` and `shopt` are Bash hacks to load things into arrays, I guess `zsh` has better ones, and writing a separate version of the script might be easier than making the Bash one cross-compatible. I'll give it a go unless you get there first.
Owner

Works for Zsh now too 🖤

Works for Zsh now too 🖤
This repo is archived. You cannot comment on issues.
No Milestone
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/abra#5
No description provided.