github.com/carter-ya/go-ethereum@v0.0.0-20230628080049-d2309be3983b/build/deb/ethereum/completions/bash/geth (about)

     1  _geth_bash_autocomplete() {
     2    if [[ "${COMP_WORDS[0]}" != "source" ]]; then
     3      local cur opts base
     4      COMPREPLY=()
     5      cur="${COMP_WORDS[COMP_CWORD]}"
     6      if [[ "$cur" == "-"* ]]; then
     7        opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} ${cur} --generate-bash-completion )
     8      else
     9        opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion )
    10      fi
    11      COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
    12      return 0
    13    fi
    14  }
    15  
    16  complete -o bashdefault -o default -o nospace -F _geth_bash_autocomplete geth