You are not logged in.

#1 2013-07-15 20:59:31

EvanPurkhiser
Member
From: San Francisco
Registered: 2010-08-17
Posts: 225
Website

[Solved] Autocmplete on -R only works on the second package argument

Hey guys,

So when using pacman (or yaourt) to remove a package the autocomplete doesn't seem to work for the first package.

For example, autocompleting the removal of "chromium"

pacman -R chro[TAB]

Does nothing, however if I type

pacman -R firefox chro[TAB]

It will properly autocomplete.

Autocomplete also works when specifying the options as

pacman -R -ns chro[TAB]

I saw this thread which describes the same issue, however the solution isn't a proper one as it just completes executables in the $PATH.

Last edited by EvanPurkhiser (2013-07-16 00:43:26)

Offline

#2 2013-07-15 21:50:24

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] Autocmplete on -R only works on the second package argument

As an additional data point, I can't replicate this.

Offline

#3 2013-07-15 21:54:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,517
Website

Re: [Solved] Autocmplete on -R only works on the second package argument

I'm on a relatively new system, where I haven't set much up, but I don't get any package-name completion which highlights the point that this is shell (and shell config) dependent.  What shell are you using?  Have you done anything to configure completion?  Do you have any pacman related aliases (or functions)?

I do, by default bash settings it seems, get filename completion with pacman -R, so the options are files in the current directory.

EDIT: (duh) just installing bash-completion now - new results momentarily - but more on point, this further highlghts the shell + config dependent nature of this.  EDIT2: works as expected with bash-completion installed.

Last edited by Trilby (2013-07-15 21:58:12)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#4 2013-07-15 23:37:11

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [Solved] Autocmplete on -R only works on the second package argument

It works for me with pacman but not at all with pacmatic regardless of which argument it is.

Is there a way to tell bash to treat one command as it would another for completion purposes?

Note that it works for me with pacman even though pacman is actually an alias for pacmatic. But not for pacmatic invoked directly.

Last edited by cfr (2013-07-15 23:38:09)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-07-16 00:42:59

EvanPurkhiser
Member
From: San Francisco
Registered: 2010-08-17
Posts: 225
Website

Re: [Solved] Autocmplete on -R only works on the second package argument

I'm using bash with bash-completion 2.1 installed.

I just tried without a .bashrc and it does indeed solve the problem. After a little binary commenting-out of options It looks like it's because of the option "shopt -s nocaseglob".

Not sure exactly why this affects completion on pacman, but it indeed does. I'll mark as solved for now since the nocaseglob option isn't all that useful to me.

Offline

Board footer

Powered by FluxBB