github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/cmd/swagger/completion/swagger.bash-completion (about)

     1  _swaggercomp() {
     2      # All arguments except the first one
     3      args=("${COMP_WORDS[@]:1:$COMP_CWORD}")
     4  
     5      # Only split on newlines
     6      local IFS=$'\n'
     7  
     8      # Call completion (note that the first element of COMP_WORDS is
     9      # the executable itself)
    10      COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}"))
    11      return 0
    12  }
    13  
    14  complete -F _swaggercomp swagger