Skip to content

Instantly share code, notes, and snippets.

@morika-t
Created April 26, 2017 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morika-t/10d25c3fcc75943197b4dcc415439a30 to your computer and use it in GitHub Desktop.
Save morika-t/10d25c3fcc75943197b4dcc415439a30 to your computer and use it in GitHub Desktop.
Concourseのflyコマンド(cli)のbash-completionファイル
# bash completion for Concourse CLI

_fly-cli() {
    # All arguments except the first one
    args=("${COMP_WORDS[@]:1:$COMP_CWORD}")
    # Only split on newlines
    local IFS=$'\n'
    # Call completion (note that the first element of COMP_WORDS is
    # the executable itself)
    COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}"))
    return 0
}
complete -F _fly-cli fly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment