Skip to content

Commit fa6d3b4

Browse files
committed
Expand tilde to $HOME in bash-completion
See https://stackoverflow.com/a/27485157.
1 parent d505a38 commit fa6d3b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/bash-completion.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ _goblint ()
2525
IFS=$'\n'
2626
local words cword cur
2727
_get_comp_words_by_ref -n = cur words cword # Bypass = in COMP_WORDBREAKS (https://stackoverflow.com/a/57437406/854540)
28-
COMPREPLY=($(${words[0]} --complete "${words[@]:1:cword}"))
28+
COMPREPLY=($(${words[0]/#\~/$HOME} --complete "${words[@]:1:cword}"))
2929
__ltrim_equal_completions "$cur" # Bypass = in COMP_WORDBREAKS (https://stackoverflow.com/a/57437406/854540)
3030
}
3131

@@ -45,7 +45,7 @@ _regtest ()
4545
*)
4646
local words cword cur
4747
_get_comp_words_by_ref -n = cur words cword # Bypass = in COMP_WORDBREAKS (https://stackoverflow.com/a/57437406/854540)
48-
COMPREPLY=($($(dirname ${words[0]})/goblint --complete "${words[@]:3:cword}"))
48+
COMPREPLY=($($(dirname ${words[0]/#\~/$HOME})/goblint --complete "${words[@]:3:cword}"))
4949
__ltrim_equal_completions "$cur" # Bypass = in COMP_WORDBREAKS (https://stackoverflow.com/a/57437406/854540)
5050
;;
5151
esac

0 commit comments

Comments
 (0)