Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
!README.md
!sce.bat
!sce.sh
!sce_completion.sh
1 change: 1 addition & 0 deletions sce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ then
# For other shells (Bash, Zsh, etc.)
echo "# for the sce dev tool"
echo "alias sce=\"$(pwd)/sce.sh\""
echo "source \"$(pwd)/sce_completion.sh\""
echo ""
exit 0
fi
Expand Down
21 changes: 21 additions & 0 deletions sce_completion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

_sce_completion() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="clone run link setup completion"
repos="Clark cleezy Quasar SCE-discord-bot SCEta"

if [[ ${prev} == "clone" || ${prev} == "run" || ${prev} == "link" ]] ; then
COMPREPLY=( $(compgen -W "${repos}" -- ${cur}) )
return 0
fi

if [[ ${cur} == * ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
}
complete -F _sce_completion sce