aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_completion.d/bd.bash
Commit message (Collapse)AuthorAgeFilesLines
* Refactor bd()/sd() completion a lotTom Ryder2018-12-061-18/+32
| | | | | | | | | | | | | | | | | | | | | | | | | Avoid very many forks; and work around Bash 3.0 bugs with array behaviour: bash-3.0$ nodes=(a b c) bash-3.0$ printf '%s\n' "${nodes[@]:1}" b c bash-3.0$ nodes=(a b) bash-3.0$ printf '%s\n' "${nodes[@]:1}" bash-3.0 Compare: bash-5.0$ nodes=(a b c) bash-5.0$ printf '%s\n' "${nodes[@]:1}" b c bash-5.0$ nodes=(a b) bash-5.0$ printf '%s\n' "${nodes[@]:1}" b bash-5.0$
* Make bd() and sd() match quoted and unquoted wordsTom Ryder2018-12-021-4/+12
| | | | | I suspect there's a more correct way to do this, but it's working well for the moment.
* Use variable for node count, not expansionTom Ryder2018-12-021-1/+1
| | | | Cheaper (I think).
* Overhaul Bash completion scriptsTom Ryder2018-12-021-23/+16
| | | | | | | | | | | Some general changes: * Apply case sensitivity switching in more contexts, using a dynamically loaded helper function * Use array counters for appending to COMPREPLY where possible * Lots more short-circuiting to limit structural depth These changes are expansive and there will definitely be bugs.
* Overhaul bd() completion againTom Ryder2018-12-011-16/+43
| | | | | | I forgot that the second positional parameter $2 to these completion functions is the word currently being completed. That's going to make things a bit less verbose.
* Remove redundant error code in short circuitsTom Ryder2018-12-011-2/+2
|
* Adjust loop short circuits and pattern matchesTom Ryder2018-12-011-2/+5
|
* Simplify an array operation in `bd` completionTom Ryder2018-12-011-1/+1
|
* Handle empty filename completions betterTom Ryder2016-08-301-1/+1
| | | | | | Bash 4.4 hangs in an awkward way (probably outputting the literal null char in some unexpected context) without this; I'm not sure if this is a bug or whether it's just been tolerated behaviour until now.
* Add -r to read to placate shellcheckTom Ryder2016-08-231-1/+1
|
* Remove error in expansion quotingTom Ryder2016-08-031-1/+1
|
* Tidy completion filesTom Ryder2016-07-301-1/+1
| | | | Add comments, add short-circuit to vared() completion
* Move bash completion setup into separate dirTom Ryder2016-07-301-0/+22