2023-02-22 08:31:38 +01:00
|
|
|
#!/bin/ksh
|
|
|
|
|
2024-01-19 22:17:16 +01:00
|
|
|
rm -f "${HOME}/.ksh/complete.ksh"
|
2023-02-22 08:31:38 +01:00
|
|
|
|
2024-01-23 19:59:05 +01:00
|
|
|
add() { ( printf '%s %s' "$1" "$2" | tr '\n' ' '; printf '\n') >> "${HOME}/.ksh/complete.ksh"; }
|
2023-02-22 08:31:38 +01:00
|
|
|
|
|
|
|
if [ -d ~/.password-store ]; then
|
|
|
|
ARGS="$(cd ~/.password-store && ls -1d */* | sed 's/\.gpg$//g;s/ /\\ /g')"
|
2023-09-18 12:24:42 +02:00
|
|
|
add "set -A complete_pass -- change edit insert show rm cp mv search find " "$ARGS"
|
2023-02-22 08:31:38 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f ${HOME}/.ssh/config ]; then
|
|
|
|
add "set -A complete_ssh -- " "$(awk '/^Host .*/ { print $2 }' ${HOME}/.ssh/config)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
add "set -A complete_kill_1 -- " "-9 -HUP -INFO -KILL -TERM"
|
|
|
|
add "set -A complete_ifconfig_1 -- " "$(ifconfig | grep ^[a-z] | cut -d: -f1)"
|
|
|
|
add "set -A complete_amused_1 -- " "add flush jump load monitor next pause play prev repeat restart show status stop toggle"
|
|
|
|
add "set -A complete_got_1 -- " "$(got -h 2>&1 | sed -n s/commands://p)"
|
|
|
|
|
2024-01-24 08:02:39 +01:00
|
|
|
add "set -A complete_make_1 -- " "$(sh ~/.ksh/complete.portvars)"
|
2023-02-22 08:31:38 +01:00
|
|
|
|
|
|
|
ARGS="reload restart stop start disable enable ls"
|
|
|
|
add "set -A complete_rcctl_1 -- " "$ARGS"
|
|
|
|
add "set -A complete_rcctl_2 -- " "$(rcctl ls all)"
|
|
|
|
add "set -A complete_got_1 -- " "$(got -h 2>&1 | sed -n s/commands://p)"
|
2024-01-17 18:18:42 +01:00
|
|
|
add "set -A complete_xdl_1 -- " "$(cd ~/x && ls -d *)"
|
2024-01-18 08:06:35 +01:00
|
|
|
add "set -A complete_ytdl_1 -- " "$(cd ~/Videos/YouTube && ls -d *)"
|
2024-01-17 18:18:42 +01:00
|
|
|
|
2023-02-22 08:31:38 +01:00
|
|
|
|
2024-01-24 08:02:39 +01:00
|
|
|
add "set -A complete_catgirl -- " "$(cd ~/.config/catgirl && ls *)"
|
2023-02-22 08:31:38 +01:00
|
|
|
|
|
|
|
add "set -A complete_man -- " "port-modules bsd.port.mk ports packages dpb make ffmpeg-complete mpv cabal-module cargo-module go-module gnome-module python-module qmake-module ruby-module cargo"
|