You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bash completion errors for invalid subcommands #975
Describe the bug
I was trying to remove a container I do not need any more.
The name of the container was rawhide-test,
so I typed: $ toolbox remove raw
and tried to save me some typing by invoking bash completion with <Tab>.
The following error was printed:
bash: options: bad array subscript
This happens because remove is not a Toolbox subcommand,
the correct command is rm,
In which case bash completion works as expected.
But, every other tool's bash completion simply does not complete or suggest anything
when there are no completions available.
Steps how to reproduce the behaviour
1.Type, but do not hit enter: $ toolbox invalid-command
2. Invoke bash completion by hitting <Tab>
Expected behaviour
Nothing happens.
Actual behaviour
Error as given in the description appears.
Screenshots
n/a
Output of toolbox --version (v0.0.90+) toolbox version 0.0.99.2
Toolbox package info (rpm -q toolbox) toolbox-0.0.99.2^3.git075b9a8d2779-4.fc35.x86_64
Output of podman version
Version: 3.4.4
API Version: 3.4.4
Go Version: go1.16.8
Built: Wed Dec 8 23:45:07 2021
OS/Arch: linux/amd64
Podman package info (rpm -q podman) podman-3.4.4-1.fc35.x86_64
Thank you both!
Pull request #840 does fix the problem,
as does using the completions from $ toolbox completion bash.
However, both solutions could still be improved like I explain in this pr comment
I am also wondering, if there is a generator for completions in place,
why is it not run during build and the result installed?
Then the completions would never get out of sync.
I am also wondering, if there is a generator for completions in place, why is it not run during build and the result installed? Then the completions would never get out of sync.
Activity
martymichal commentedon Jan 8, 2022
Thank you for the report, @oturpe! I can reproduce it on my machine, too. I believe #840 should fix this.
olivergs commentedon Jan 10, 2022
The problem right now is that the completion file shipped is out of sync with the completion system we already have implemented upstream.
If you want a workaround, just do:
toolbox completion bash > right_completionsand then
source ./right_completionsAfter that you will get the right behaviour.
The fix upstream should be as easy as replacing the current bash completion file with the contents of the right_completions file.
oturpe commentedon Jan 10, 2022
Thank you both!
Pull request #840 does fix the problem,
as does using the completions from
$ toolbox completion bash.However, both solutions could still be improved like I explain in this pr comment
I am also wondering, if there is a generator for completions in place,
why is it not run during build and the result installed?
Then the completions would never get out of sync.
martymichal commentedon Jan 10, 2022
Mmm... I believe these are the same :).
Thanks for the insight!
That's what #840 is trying to accomplish :).