Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2038535 - Bash completion errors for invalid subcommands
Summary: Bash completion errors for invalid subcommands
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: toolbox
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Debarshi Ray
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-08 09:17 UTC by Otto Liljalaakso
Modified: 2023-03-18 05:01 UTC (History)
5 users (show)

Fixed In Version: toolbox-0.0.99.4-1.fc38 toolbox-0.0.99.4-1.fc37 toolbox-0.0.99.4-1.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-03-18 00:17:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github containers toolbox issues 975 0 None open Bash completion errors for invalid subcommands 2022-01-08 09:17:33 UTC

Description Otto Liljalaakso 2022-01-08 09:17:34 UTC
Description of problem:

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.

Version-Release number of selected component (if applicable):
0.0.99.2^3.git075b9a8d2779-4.fc35.x86_64


How reproducible:
Always


Steps to Reproduce:
1.Type, but do not hit enter: `$ toolbox invalid-command `
2. Invoke bash completion by hitting `<Tab>`


Actual results:
Error as given in the description appears.


Expected results:
Nothing happens.

Additional info:
n/a

Comment 1 Oliver Gutiérrez 2022-01-10 13:34:15 UTC
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_completions

and then

source ./right_completions

After 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.

Comment 2 Otto Liljalaakso 2022-01-10 20:48:26 UTC
Thank you, the workaround works.
I already suggested this upstream,
but if a generator for those completions is available,
why not just run it during the build?
It could be done in upstream build script,
or even in the specfile.

Comment 3 Oliver Gutiérrez 2022-01-10 21:02:20 UTC
That's another option. I think it is better to just run that during the build so always is in sync. Good idea :)

Comment 4 Ben Cotton 2022-11-29 17:37:07 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 5 Ben Cotton 2023-02-07 14:52:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 6 Fedora Update System 2023-03-08 21:08:50 UTC
FEDORA-2023-75cd961bc6 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-75cd961bc6

Comment 7 Fedora Update System 2023-03-08 21:09:23 UTC
FEDORA-2023-992b8bea0b has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-992b8bea0b

Comment 8 Fedora Update System 2023-03-08 21:09:39 UTC
FEDORA-2023-b66ac41fe4 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2023-b66ac41fe4

Comment 9 Fedora Update System 2023-03-18 00:17:24 UTC
FEDORA-2023-75cd961bc6 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2023-03-18 04:57:53 UTC
FEDORA-2023-992b8bea0b has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2023-03-18 05:01:20 UTC
FEDORA-2023-b66ac41fe4 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.