aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_completion.d/sd.bash
Commit message (Collapse)AuthorAgeFilesLines
* Refactor bd()/sd() completion a lotTom Ryder2018-12-061-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | 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-9/+19
| | | | | I suspect there's a more correct way to do this, but it's working well for the moment.
* Remove unneeded bracesTom Ryder2018-12-021-1/+1
|
* Overhaul Bash completion scriptsTom Ryder2018-12-021-40/+20
| | | | | | | | | | | 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.
* Use the positional parameter aliases for wordsTom Ryder2018-12-011-1/+1
| | | | | The current word is available in $2, and the previous word in $3. That's easier (and maybe a bit less expensive) to dig out, so let's use it.
* Remove redundant error code in short circuitsTom Ryder2018-12-011-1/+1
|
* Adjust loop short circuits and pattern matchesTom Ryder2018-12-011-3/+7
|
* Remove null-result guard from completion gensTom Ryder2018-12-011-8/+2
| | | | I don't believe these are needed anymore, or possibly ever were.
* Use simpler method of no case completion checkTom Ryder2018-12-011-11/+6
|
* Add left-parens to inner case statementsTom Ryder2018-10-311-2/+2
| | | | | This helps older versions of Bash understand that the surrounding subshell isn't terminating.
* Add missing ;; terminatorsTom Ryder2018-10-311-0/+1
|
* Respect completion-ignore-case in custom functionsTom Ryder2018-10-301-0/+14
| | | | | | This involves a little too much boilerplate for my liking, but it's still an improvement over what I had before. I might find a way to make this into a generic function.
* Correct comment spelling errorTom Ryder2017-05-261-1/+1
|
* Add some missing "local" callsTom Ryder2016-12-121-0/+1
|
* Handle empty filename completions betterTom Ryder2016-08-301-5/+9
| | | | | | 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.
* Move bash completion setup into separate dirTom Ryder2016-07-301-0/+39