A micro-journaling tool https://git.josias.dev/jw
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
jw/jw.bash-completion

20 lines
480 B

#!/bin/bash
__jw()
{
local cur prev subcommands
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
subcommands="version help new post search list tags edit"
if [[ " ${subcommands[*]} " == *" ${prev} "* ]] ; then
COMPREPLY=( $(compgen -W "$(jw list)" -- ${cur}) )
return 0
elif [[ ${cur} == * ]] ; then
COMPREPLY=( $(compgen -W "${subcommands}" -- ${cur}) )
return 0
fi
}
complete -F __jw jw