1# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2_abicompat_module()
3{
4	local cur prev OPTS
5	COMPREPLY=()
6	cur="${COMP_WORDS[COMP_CWORD]}"
7	prev="${COMP_WORDS[COMP_CWORD-1]}"
8	case $prev in
9	  '--app-debug-info-dir'|'--lib-debug-info-dir1'|'--lib-debug-info-dir2')
10	    local IFS=$'\n'
11	    compopt -o dirnames
12	    COMPREPLY=( $(compgen -d -- $cur) )
13	    return 0
14	    ;;
15	  '--suppressions')
16	    local IFS=$'\n'
17	    compopt -o filenames
18	    COMPREPLY=( $(compgen -f -- $cur) )
19	    return 0
20	    ;;
21	  '--drop' | '--drop-fn' | '--drop-var' | '--keep' | '--keep-fn' | '--keep-var')
22	  #'--{drop,keep}{,-fn,-var}')
23	    COMPREPLY=( $(compgen -W "string" -- $cur) )
24	    return 0
25	    ;;
26	esac
27	case $cur in
28	  -*)
29		#TODO: not done, short options missing etc..
30	    OPTS="  --app-debug-info-dir1
31		    --help
32		    --lib-debug-info-dir1
33		    --lib-debug-info-dir2
34		    --list-undefined-symbols
35		    --no-redundant
36		    --redundant
37		    --show-base-names
38		    --no-show-locs
39		    --suppressions
40		    --weak-mode"
41	    COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
42	    return 0
43	    ;;
44	esac
45	local IFS=$'\n'
46	compopt -o filenames
47	COMPREPLY=( $(compgen -f -- $cur) )
48	return 0
49}
50complete -F _abicompat_module abicompat
51