diff --git a/yash/z.sh b/yash/z.sh index 5702e2c..9fbfb53 100644 --- a/yash/z.sh +++ b/yash/z.sh @@ -5,6 +5,22 @@ _z_exec() { return $? } +function completion/z { + OPTIONS=( #># + "h:; show help text" + "l:; list aliases" + "a:; add a new alias" + "r:; remove alias" + ) #<# + + command -f completion//parseoptions -n + if [ -z "$ARGOPT" ] || [ "$ARGOPT" = "r" ]; then + complete -T $(_z_exec "select alias from jump_list") + elif [ "$ARGOPT" = "-" ]; then + command -f completion//completeoptions + fi +} + ! [ -d ~/.config/z ] && mkdir -p ~/.config/z ! [ -f "$JUMP_LIST" ] && _z_exec 'create table jump_list (alias text primary key, directory text not null)'