3 local cur prev words cword
5 _init_completion || return
8 if [[ "$cword" == "1" ]]; then
9 COMPREPLY=( $( compgen -W '$(lctl --list-commands |
10 grep -v '^=')' -- "$cur" ) )
15 set_param|list_param|get_param)
17 [[ "${words[1]}" == "set_param" ]] && filter="/[^=/]$/d"
18 mapfile -t COMPREPLY < <(
19 lctl list_param -F "${cur#[\"\']}*" 2>/dev/null |
20 sed -e "$filter" -e 's#/$#.#' \
21 -e "s#^${cur//\*/[^.]*}#$cur#"
29 complete -F _lctl lctl