-
-
Save fk128/6ca62ac3580cefc52d25d13d57683d13 to your computer and use it in GitHub Desktop.
jrnl bash completion for listing journals
This file contains hidden or 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
# place file in /etc/bash_completion.d/ | |
_jrnl() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts="`jrnl -ls`" | |
if [ "$COMP_CWORD" -eq 1 ]; then | |
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | |
fi | |
return 0 | |
} | |
complete -F _jrnl jrnl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment