Bug 858248

Summary: [RFE]: scl command should have bash completion. PATCH included.
Product: [Fedora] Fedora Reporter: Miroslav Hradílek <mhradile>
Component: scl-utilsAssignee: Jindrich Novy <jnovy>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: rawhideCC: bkabrda, jnovy, jzeleny, pknirsch
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 858251 (view as bug list) Environment:
Last Closed: 2012-09-21 10:40:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 858251    
Attachments:
Description Flags
Proposed patch
none
Proposed patch v1.1 none

Description Miroslav Hradílek 2012-09-18 12:31:38 UTC
Description of problem:

Utility scl is called on a regular basis and it is annoying to write everything by hand every time.

Expected results:

Bash completion should complete available scriptlets and collections automatically.

Comment 1 Miroslav Hradílek 2012-09-18 12:33:26 UTC
Created attachment 613999 [details]
Proposed patch

Also Patch added :)

Comment 2 Jindrich Novy 2012-09-21 09:45:22 UTC
Hi Miroslav, thanks for the autocompletion script!

Just a few points I noticed while using it for autocompletion:

$ scl -l
example
example123

$ scl enable <tab>

expands to:

$ scl enable example123-

which doesn't seem to be correct. The correct result should be:

$ scl enable example

turning to:

$ scl enable example123

after the next tab.

Could you please fix the completition script so that I can apply it upstream?

Thanks!

Comment 3 Jindrich Novy 2012-09-21 10:40:39 UTC
Ok, consulted that with Miroslav and did minor modifications. It is now comitted to upstream.

Comment 4 Miroslav Hradílek 2012-09-21 10:51:44 UTC
Created attachment 615376 [details]
Proposed patch v1.1

Nev version: Searching for collections in /etc/scl/prefixes now as proposed. Only installed collections should be listed this way.