Closed ja-he closed 2 months ago
go-flags allows for low-effort completion by running the binary with GO_FLAGS_COMPLETION=1; then all it takes is this completion script to be sourced to /usr/share/bash-completion/completions.
go-flags
GO_FLAGS_COMPLETION=1
/usr/share/bash-completion/completions
_dayplan_completion() { args=("${COMP_WORDS[@]:1:$COMP_CWORD}") local IFS=$'\n' COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}")) return 0 } complete -F _dayplan_completion dayplan
From my testing, it does overcomplete a bit, but I think usage is a bit too flexible for me to want to write the bash completion manually.
I did this for the AUR package, so I guess this is done? Not so crucial at least.
go-flags
allows for low-effort completion by running the binary withGO_FLAGS_COMPLETION=1
; then all it takes is this completion script to be sourced to/usr/share/bash-completion/completions
.From my testing, it does overcomplete a bit, but I think usage is a bit too flexible for me to want to write the bash completion manually.