We've probably all been bitten at least once, if not many times, by the fact that urpmi does not ask for confirmation when you try to autocomplete a package name, and you made a mistake like: # urpmi task <TAB> (note the whitespace after "task", thus urpmi tries to complete an empty string, and it can take quite a while to get the results) A way to workaround this issue might be to prevent autocompletion if the argument to complete is empty (as above). Reproducible: Steps to Reproduce:
CC: (none) => thierry.vignaud
Priority: Normal => Low
Source RPM: urpmi => bash-completion, urpmi
Hardware: i586 => All
Guillaume, any though on how to do that?
CC: (none) => guillomovitch
The following line in _urpmi_package function should be enough: [ -z $cur ] && return 0 However, I don't think it would be very wise to introduce such kind of hardcoded trick in a specific completion. A configurable completion treshold, defined in a COMP_URPMI_TRESHOLD environment variable, would a be better option: [[ ${#cur} -lt $COMP_URPMI_TRESHOLD ]] && return 0
(In reply to Guillaume Rousse from comment #2) > > However, I don't think it would be very wise to introduce such kind of > hardcoded trick in a specific completion. A configurable completion > treshold, defined in a COMP_URPMI_TRESHOLD environment variable, would a be > better option: > > [[ ${#cur} -lt $COMP_URPMI_TRESHOLD ]] && return 0 That sounds like a good plan to me. Which package should define this variable? urpmi?
packages don't define variables, they just install files. Just document it somewhere in urpmi READMI file.
Assignee: bugsquad => mageiatools