Skip to content

Commit

Permalink
add autocomplete files
Browse files Browse the repository at this point in the history
  • Loading branch information
lucagrulla committed Jan 24, 2021
1 parent d1c3327 commit 9dd90ef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cw.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
_cw_bash_autocomplete() {
local cur prev opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
opts=$( ${COMP_WORDS[0]} --completion-bash ${COMP_WORDS[@]:1:$COMP_CWORD} )
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _cw_bash_autocomplete cw
13 changes: 13 additions & 0 deletions cw.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#compdef cw
autoload -U compinit && compinit
autoload -U bashcompinit && bashcompinit

_cw_bash_autocomplete() {
local cur prev opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
opts=$( ${COMP_WORDS[0]} --completion-bash ${COMP_WORDS[@]:1:$COMP_CWORD} )
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _cw_bash_autocomplete cw

0 comments on commit 9dd90ef

Please sign in to comment.