You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cf CLI supports bash completion "natively" as offered by the command line parser library it uses. Enabling it is as simple as installing the following bash completion file:
# bash completion for cf
_cf() {
# 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 _cf cf
In other words, running the cf command with environment variable GO_FLAGS_COMPLETION=1 makes it return a list of completions (subcommands and flags).
If we could have a clink completion script for that, it may be fairly easy to support completions for this command, as well as any other Goflags library based CLI.
The text was updated successfully, but these errors were encountered:
dkoper
pushed a commit
to dkoper/clink-completions
that referenced
this issue
Feb 14, 2017
I would like include this, but it has a dangerous problem:
It runs the entire command line on every completion, including other commands in the command line: del * & cf Tab will actually run both the del * and the cf command.
This can be partially mitigated by using clink.parseline() and using only the last line_state.
But that's not sufficient, either -- for example: >foo cf Tab will run the command and redirect output to foo.
To be able to include this, the argmatcher would need to be change to be more discriminating about what it runs. For example, it could use Responding to Arguments in Argmatchers and user_data to collect the words that are relevant to the cf command itself, and run only cf with only those arguments.
Cloud Foundry is an open source, multi cloud application platform and it has a Command Line tool to interact with it.
The
cf
CLI supports bash completion "natively" as offered by the command line parser library it uses. Enabling it is as simple as installing the following bash completion file:In other words, running the
cf
command with environment variableGO_FLAGS_COMPLETION=1
makes it return a list of completions (subcommands and flags).If we could have a clink completion script for that, it may be fairly easy to support completions for this command, as well as any other Goflags library based CLI.
The text was updated successfully, but these errors were encountered: