ZSH completions

This commit is contained in:
Nox Sluijtman 2023-10-20 17:55:10 +02:00
parent c709793a7d
commit b9cf6d786c
5 changed files with 42 additions and 7 deletions

View file

@ -28,9 +28,10 @@
'';
installPhase = ''
mkdir -p $out/{share/man/man1,bin}
mkdir -p $out/{share/man/man1,bin,share/zsh/site-functions}
cp bin/* $out/bin/
cp *.1 $out/share/man/man1
cp completions/* $out/share/zsh/site-functions/
cp *.1 $out/share/man/man1/
'';
};
};

View file

@ -1,7 +1,7 @@
#!/bin/sh
usage(){ printf "Usage: %s -s|f|r|d|R|h\n" $(basename $0); }
[ $# -eq 0 ] && usage && exit 2
bookmarks="${BOOKMARKS:-"$HOME/.config/qutebrowser/bookmarks/urls"}"
while getopts sfrdRh name; do
case $name in

View file

@ -1,9 +1,7 @@
#!/bin/sh
usage(){
printf "Usage: %s -s|f|r|d|R|h\n" $(basename $0)
}
usage(){ printf "Usage: %s -s|f|r|d|R|h\n" $(basename $0); }
[ $# -eq 0 ] && usage && exit 2
bookmarks="${BOOKMARKS:-"$HOME/.config/qutebrowser/bookmarks/urls"}"
while getopts sfrdRh name; do
case $name in

View file

@ -0,0 +1,18 @@
#compdef _copy-bookmark copy-bookmark
_arguments : \
"(-f -r -d -R -h)-f[use 'fzf' to open bookmarks file]" \
"(-s -r -d -R -h)-r[use 'rofi' to open bookmarks file]" \
"(-s -f -d -R -h)-s[use 'sk' to open bookmarks file]" \
"(-s -f -r -R -h)-d[use '$MENU' to open bookmarks file]" \
"(-s -f -r -d -h)-R[copy random bookmark]" \
"(-s -f -r -d -R)-h[print usage and exit]"
_arguments : $arguments

View file

@ -0,0 +1,18 @@
#compdef _open-bookmark open-bookmark
_arguments : \
"(-f -r -d -R -h)-f[use 'fzf' to open bookmarks file]" \
"(-s -r -d -R -h)-r[use 'rofi' to open bookmarks file]" \
"(-s -f -d -R -h)-s[use 'sk' to open bookmarks file]" \
"(-s -f -r -R -h)-d[use '$MENU' to open bookmarks file]" \
"(-s -f -r -d -h)-R[open random bookmark]" \
"(-s -f -r -d -R)-h[print usage and exit]"
_arguments : $arguments