-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bash completion script for bee added
- Loading branch information
Matthias Ruester
committed
Jan 26, 2012
1 parent
2cbdbb5
commit 78e77b7
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
_bee_completion() | ||
{ | ||
COMPREPLY=() | ||
|
||
cur="${COMP_WORDS[COMP_CWORD]}" | ||
prev="${COMP_WORDS[COMP_CWORD-1]}" | ||
|
||
options="init install remove check query list" | ||
ls=$(ls $pwd) | ||
|
||
if [ "${prev}" = "bee" ]; then | ||
COMPREPLY=($(compgen -W "${options} ${ls}" -- ${cur}) ) | ||
return 0 | ||
fi | ||
|
||
packages=$(bee list -a) | ||
COMPREPLY=($(compgen -W "${packages} ${ls}" -- ${cur}) ) | ||
|
||
return 0 | ||
} | ||
|
||
complete -F _bee_completion bee |