You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
603 B

  1. # To enable bash completion:
  2. #
  3. # 1. Ensure python-argcomplete is installed:
  4. # pip install argcomplete
  5. # 2. Source this file:
  6. # . nilmtool-bash-completion.sh
  7. _nilmtool_argcomplete() {
  8. local IFS=$(printf "\013")
  9. COMPREPLY=( $(IFS="$IFS" \
  10. COMP_LINE="$COMP_LINE" \
  11. COMP_WORDBREAKS="$COMP_WORDBREAKS" \
  12. COMP_POINT="$COMP_POINT" \
  13. _ARGCOMPLETE=1 \
  14. "$1" 8>&1 9>&2 1>/dev/null 2>/dev/null) )
  15. if [[ $? != 0 ]]; then
  16. unset COMPREPLY
  17. fi
  18. }
  19. complete -o nospace -F _nilmtool_argcomplete nilmtool