Bug 856691 - Beaker completion in bash-completion
Summary: Beaker completion in bash-completion
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Callaghan
QA Contact:
URL:
Whiteboard:
: 862143 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-12 15:15 UTC by Filip Holec
Modified: 2019-05-22 13:43 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-11 23:49:45 UTC
Embargoed:


Attachments (Terms of Use)
bkr.bash (1.57 KB, text/plain)
2012-09-12 15:15 UTC, Filip Holec
no flags Details

Description Filip Holec 2012-09-12 15:15:08 UTC
Created attachment 612149 [details]
bkr.bash

Description of problem:
This project is an enhancement (Future Feature) for beaker. Its main purpose is to provide more comfort when typing beaker commands.

Install:
1. Install bash-completion
2. Download file bkr.bash
3. Move it to /etc/bash_completion.d/ as root
4. Restart terminal

Example of usage:

bkr wor<TAB><TAB>
bkr workflow-

bkr workflow-t<TAB><TAB>
bkr workflow-tcms

bkr workflow-tcms --com<TAB><TAB>
bkr workflow-tcms --component

Comment 1 Dan Callaghan 2012-09-12 22:16:35 UTC
Thanks! I haven't tested it yet but it looks good. I have been thinking for ages that we need a bash completion script.

Comment 2 Dan Callaghan 2012-09-18 23:36:07 UTC
On Gerrit for review: http://gerrit.beaker-project.org/1359

Comment 4 Amit Saha 2012-10-02 03:25:25 UTC
Verified. But see: https://bugzilla.redhat.com/show_bug.cgi?id=862143

Comment 5 Dan Callaghan 2012-10-02 03:34:05 UTC
*** Bug 862143 has been marked as a duplicate of this bug. ***

Comment 6 Dan Callaghan 2012-10-02 03:34:46 UTC
We will need to fix the stderr spew as described by Amit in bug 862143.

Comment 7 Dan Callaghan 2012-10-02 03:58:03 UTC
Fix is on Gerrit: http://gerrit.beaker-project.org/1395

Comment 10 Raymond Mancy 2012-10-11 06:10:55 UTC
The bash completion of 'bkr' lists '--password' as an option, bash completion of
'bkr --password' lists the following

[rmancy@rmancy ~]$ bkr --password --
--help      --help]     --password  --username 

Notice the '--help]'. Also, none of these completions actually render a sensible command.

Comment 11 Filip Holec 2012-10-11 07:36:39 UTC
This should fix it:

<local opts=$(echo $( bkr $component --help 2>/dev/null | grep -o -- '--[^ =]*' | sort | uniq ) --help )
>local opts=$(echo $( bkr $component --help 2>/dev/null | grep -v "Usage:"  | grep -o -- '--[^ =]*' | sort | uniq ) --help )

Comment 12 Dan Callaghan 2012-10-11 23:49:45 UTC
Beaker 0.9.4 has been released.


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