Bug 860510 - Bash Completion doesn't complete LVM devices for "lvresize" when "-L" is used
Summary: Bash Completion doesn't complete LVM devices for "lvresize" when "-L" is used
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: bash-completion
Version: 17
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-26 02:41 UTC by CJ Kucera
Modified: 2013-04-20 20:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-18 02:43:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description CJ Kucera 2012-09-26 02:41:47 UTC
Description of problem:

On my F17 box, typing a simple "lvresize /dev/foo<tab>" will let me tab-complete the devices I'd expect to be able to use (namely, /dev/vgname/lvname or /dev/mapper/vgname-lvname).

If I run the command as "lvresize -L +10G /dev/foo<tab>" however, I can't actually tab-complete any of those devices.

Oddly, when I've done it with the arguments, the ONLY device which DOES tab-complete properly in that case is /dev/md126 (which is my main RAID volume).

Not a big deal, but annoying.

Comment 1 Jonathan Nicol 2012-11-13 00:53:06 UTC
I'll second this, it doesn't like a space between -L and the argument:

# ls /dev/vg<tab><tab>
vg0/         vg1/         vga_arbiter
(good)

# lvresize <tab><tab>
/dev/vg0/lv_home   /dev/vg0/lv_root   /dev/vg0/lv_swap   /dev/vg1/software  /dev/vg1/virts     
(good)

# lvresize -L40G <tab><tab>
/dev/vg0/lv_home   /dev/vg0/lv_root   /dev/vg0/lv_swap   /dev/vg1/software  /dev/vg1/virts     
(good)

# lvresize -L 40G <tab><tab>
/dev/sda2  /dev/sdb1  
(bad)

Comment 2 Ville Skyttä 2012-11-13 22:00:34 UTC
(In reply to comment #1)
> I'll second this, it doesn't like a space between -L and the argument:

Ah, that's the key - thanks for bringing it up. Various lvm completions use quite fragile argument counting which didn't take into account options that are known to take an argument such as -L. Still fragile but the known cases are hopefully now fixed upstream - I don't know/use lvm myself so beware:

http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=e96613e32e21ea389dddba9756bf3d78070acc4b

That diff doesn't apply over vanilla 2.0, but you should be able to grab the whole file/blob and replace /usr/share/bash-completion/completions/lvm with it.

Comment 3 Jonathan Nicol 2012-11-14 00:47:03 UTC
works for me, thanks very much :)

Comment 4 Fedora Update System 2013-04-08 20:11:20 UTC
bash-completion-2.1-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/bash-completion-2.1-1.fc18

Comment 5 Fedora Update System 2013-04-08 20:12:35 UTC
bash-completion-2.1-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/bash-completion-2.1-1.fc19

Comment 6 Fedora Update System 2013-04-10 01:39:21 UTC
Package bash-completion-2.1-2.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing bash-completion-2.1-2.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5298/bash-completion-2.1-2.fc18
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-04-18 02:43:36 UTC
bash-completion-2.1-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2013-04-20 20:06:18 UTC
bash-completion-2.1-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, 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.