ksh-completion

Korn shell completion installer
Log | Files | Refs

commit 4716c421c98c804d01d8f5a707a47613ba49acce
Author: Miniontoby <tobias.gaarenstroom@gmail.com>
Date:   Tue, 11 Jan 2022 12:54:20 +0000

Initial import

Diffstat:
A.ksh_completion | 208+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 208 insertions(+), 0 deletions(-)

diff --git a/.ksh_completion b/.ksh_completion @@ -0,0 +1,208 @@ +function reload_completions { + if [ -e ~/.ksh_completions ]; then . ~/.ksh_completions; fi +} + +set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p) +set -A complete_git_1 -- $(git help -a | sed -e 's/ //;s/ .*//;s/.*\/.*//;s/.* .*//') +set -A complete_kill_1 -- -9 -HUP -INFO -KILL -TERM +set -A complete_kill_2 -- $(ps ax | sed -e "s/^ *//" -e "s/ .*//") + +pgrep -q vmd +if [ $? = 0 ]; then + set -A complete_vmctl -- console load reload start stop reset status send receive + set -A complete_vmctl_2 -- $(vmctl status | awk '!/NAME/{print $NF}') +fi + +pgrep -q mpd +if [ $? = 0 ]; then + set -A complete_mpc_1 -- lsplaylists ls play pause toggle prev random shuffle stop update + set -A complete_mpc_2 -- $(mpc lsplaylists | sort) +fi + +read_known_hosts() { + local _file=$1 _line _host + while read _line ; do + _line=${_line%%#*} # delete comments + _line=${_line%%@*} # ignore markers + _line=${_line%% *} # keep only host field + + [[ -z $_line ]] && continue + + local IFS=, + for _host in $_line; do + _host=${_host#\[} + _host=${_host%%\]*} + for i in ${HOST_LIST[*]}; do + [[ $_host == $i ]] && continue 2 + done + set -s -A HOST_LIST ${HOST_LIST[*]} $_host + done + done <$_file +} + +[[ -s /etc/ssh/ssh_known_hosts ]] && read_known_hosts /etc/ssh/ssh_known_hosts +[[ -s ~/.ssh/known_hosts ]] && read_known_hosts ~/.ssh/known_hosts + +set -A complete_ssh -- ${HOST_LIST[*]} +set -A complete_scp -- ${HOST_LIST[*]} +set -A complete_mosh -- ${HOST_LIST[*]} + +if [ -d /var/db/pkg ]; then + PKG_LIST=$(ls -1 /var/db/pkg) + set -A complete_pkg_delete -- $PKG_LIST + set -A complete_pkg_info -- $PKG_LIST + set -A complete_pkg_check -- $PKG_LIST + set -A complete_pkg_add -- $PKG_LIST +fi + +if [ ! -f /tmp/man_list ]; then + MANPATH=/usr/share/man man -k Nm~. | cut -d\( -f1 | tr -d , | sort | uniq > /tmp/man_list +fi +set -A complete_man_1 -- $(cat /tmp/man_list) + +pgrep -fq '/usr/sbin/vmd' +if [ $? = 0 ]; then + set -A complete_vmctl -- console load reload start stop reset status send receive + set -A complete_vmctl_2 -- $(vmctl status | awk '!/NAME/{print $NF}') +fi + +if [ -e /usr/local/bin/rclone ]; then + if [ -f ~/.config/rclone/rclone.conf ]; then + RCLONE_LIST=$(rclone listremotes) + set -A complete_rclone_1 -- \ + about authorize \ + cachestats cat check cleanup config copy copyto \ + copyurl cryptcheck \ cryptdecode \ + dbhashsum dedupe delete deletefile \ + genautocomplete gendocs \ + hashsum help \ + link listremotes ls lsd lsf lsjson lsl \ + md5sum mkdir move moveto \ + ncdu \ + obscure \ + purge \ + rc rcat rcd rmdir rmdirs \ + serve settier sha1sum size sync \ + touch tree \ + version + set -A complete_rclone -- $RCLONE_LIST + fi +fi + +if [ -x /usr/rbin/rcctl ]; then + set -A complete_rcctl_1 -- disable enable get ls order set restart start stop + set -A complete_rcctl_2 -- $(rcctl ls all) +fi + +set -A complete_make_1 -- \ + clean \ + install \ + port-lib-depends-check \ + reinstall \ + repackage + +set -A complete_rcctl_1 -- disable enable get ls order set restart start stop +set -A complete_rcctl_2 -- $(rcctl ls all) + +set -A complete_signify_1 -- -C -G -S -V +set -A complete_signify_2 -- -q -p -x -c -m -t -z +set -A complete_signify_3 -- -p -x -c -m -t -z + +set -A complete_make_1 -- install clean repackage reinstall + +set -A complete_beet_1 -- as clearart config duplicates embedart extractart fetchart fields fingerprint help import lastgenre list lyrics \ + mbsync missing modify move mpdstats remove scrub splupdate stats submit update version web write + +set -A complete_emacs -- --daemon --debug-init +set -A complete_emacsclient -- -c -t + +set -A complete_gpg2 -- \ + --armor \ + --clearsign \ + --decrypt \ + --detach-sig \ + --list-key \ + --receive-keys \ + --refresh \ + --sign \ + --verify + + +if [ -f /dev/mixer ]; then + set -A complete_mixerctl_1 -- $(mixerctl | cut -d= -f 1) +fi + +if [ -d ~/.dynamic-colors ]; then + set -A complete_dynamic_colors -- \ + audit \ + create cycle \ + edit \ + help \ + init \ + list \ + switch + set -A complete_dynamic_colors_2 -- $(dynamic_colors list) +fi + +if [ -e /usr/local/bin/opm ]; then + if [ -d ~/.opm ]; then + set -A complete_opm_1 -- -b -c -d -h -m \ + add \ + del \ + encrypt \ + get \ + insert \ + list ls \ + rm \ + search show \ + verify + set -A complete_opm -- $(/usr/local/bin/opm -b ls) + fi +fi + +if [ -e /usr/local/bin/gopass ]; then + PASS_LIST=$(gopass ls -f) + set -A complete_gopass -- $PASS_LIST \ + audit \ + bin binary \ + clone completion config copy cp create \ + delete \ + edit \ + find fix fsck \ + generate git grep \ + h help hotp \ + init insert \ + jsonapi \ + list ls \ + mounts move mv \ + new \ + otp \ + recipients remove rm \ + search set setup show sync \ + templates totp \ + unclip update \ + version + set -A complete_pass -- $PASS_LIST \ + audit \ + bin binary \ + clone completion config copy cp create \ + delete \ + edit \ + find fix fsck \ + generate git grep \ + h help hotp \ + init insert \ + jsonapi \ + list ls \ + mounts move mv \ + new \ + otp \ + recipients remove rm \ + search set setup show sync \ + templates totp \ + unclip update \ + version +fi + +set -A complete_hg_1 -- add annotate clone commit diff export forget help init log merge pull push remove serve status summary update +