_astra_kcm_open()
{
  local cur prev words cword split
  _init_completion -s || return

  if [[ $cword == 1 || ( $cword == 3 && "${words[1]}" == --args ) ]]; then
    if [[ $cur == -* ]]; then
      COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur"))
    else
      COMPREPLY=($(compgen -W '$("$1" --list 2>/dev/null | grep - | cut -f1 -d\ )' -- "$cur"))
    fi
  fi
} && complete -F _astra_kcm_open astra-kcm-open
