-
Notifications
You must be signed in to change notification settings - Fork 3
/
completions
31 lines (27 loc) · 885 Bytes
/
completions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
alias rwt=third_party/WebKit/Tools/Scripts/run-webkit-tests
_layout_tests()
{
local search_prefix="third_party/WebKit/LayoutTests/"
local cur=${COMP_WORDS[COMP_CWORD]}
case $cur in
*/)
local dir_part="$cur"
local search_path="$search_prefix$dir_part"
local last_part=""
;;
*)
local dir_part="$(dirname "$cur")/"
local search_path="$search_prefix$dir_part"
local last_part=$(basename "$cur")
;;
esac
local files=$(find "$search_path" -maxdepth 1 \( -name "$last_part*" -type d -printf "$dir_part%P/ " -o -name "$last_part*.html" -printf "$dir_part%P\n" \) | sed 's/^\.\///' | grep -v //)
#echo '***'
#echo "$files"
#echo '***'
local IFR=$'\n'
compopt -o nospace
COMPREPLY=( $(compgen -W "$files" -- $cur) )
}
complete -F _layout_tests run-webkit-tests
complete -F _layout_tests rwt