#!/usr/bin/env bash # # Shhh command line completion # # © 2015-2016, Konstantin Gredeskoul, https://github.com/kigster/shhh # MIT LICENSE # _shhh() { local SHHH_OPTS SHHH_POINTS cur prev cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" COMPREPLY=() SHHH_COMP_OPTIONS=$(shhh --dictionary) [[ $COMP_CWORD == 1 ]] && SHHH_COMP_OPTIONS="${SHHH_COMP_OPTIONS} ${SHHH_COMMANDS}" COMPREPLY=( $(compgen -W "${SHHH_COMP_OPTIONS}" -- ${cur}) ) return 0 } complete -F _shhh shhh