# Check for bash
[ -z "$BASH_VERSION" ] && return

__app ()
{
  local cur prev options

  # Array variable storing the possible completions.
  COMPREPLY=()
  CURRENT=${COMP_WORDS[COMP_CWORD]}
  cur="${COMP_WORDS[COMP_CWORD]}"
  prev="${COMP_WORDS[COMP_CWORD-1]}"
  options="--daemon --debug --help --nologin --verbose --version"

  case "$cur" in
    *)
      COMPREPLY=($(compgen -W "${options}" -- $cur));;
  esac

  return 0
}

complete -F __app chatty
