From 05b501dbade96308f64c9f1f477956c38cf795ce Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Thu, 11 Mar 2021 15:40:09 +0000 Subject: [PATCH] expand completion docs --- completions/gopass.org | 53 ++++++++++++++++++++++++++++++++++++++++++ completions/got.org | 48 ++++++++++++++++++++------------------ completions/man.org | 18 ++++++++++++++ completions/mpc.ksh | 3 ++- completions/mpc.org | 35 ++++++++++++++++++++++++++++ completions/rc.org | 12 ++++++++++ completions/ssh.org | 9 +++++++ completions/vmd.org | 16 +++++++++++++ 8 files changed, 170 insertions(+), 24 deletions(-) diff --git a/completions/gopass.org b/completions/gopass.org index ab4fe1c..c8b5851 100644 --- a/completions/gopass.org +++ b/completions/gopass.org @@ -1 +1,54 @@ #+TITLE: Completions: gopass + +** Any level + +#+begin_src shell + $PASS_LIST \ + agent \ + audit \ + binary \ + bin \ + clone \ + completion \ + config \ + copy \ + cp \ + create \ + new \ + delete \ + remove \ + rm \ + edit \ + set \ + find \ + search \ + fsck \ + generate \ + git-credential \ + jsonapi \ + otp \ + totp \ + hotp \ + git \ + grep \ + history \ + hist \ + init \ + insert \ + list \ + ls \ + move \ + mv \ + mounts \ + recipients \ + setup \ + show \ + sync \ + templates \ + unclip \ + update \ + version \ + xc \ + help \ + h +#+end_src diff --git a/completions/got.org b/completions/got.org index fd1ba33..4f23c9e 100644 --- a/completions/got.org +++ b/completions/got.org @@ -4,30 +4,32 @@ The ~got~ completion currently supports the following arguments: ** Level 1 #+begin_src ksh - add \ - bl blame \ - bo backout \ - br branch \ - cat \ - ci commit \ - cl clone \ - co checkout \ - cy cherrypick \ - di diff \ - fe fetch \ - he histedit \ - ig integrate \ - im import \ - in init \ + init \ + import im \ + clone cl \ + fetch fe \ + checkout co \ + update up \ + status st \ log \ - rb rebase \ + diff di \ + blame bl \ + tree tr \ ref \ - rm remove \ - rv revert \ - sg stage \ - st status \ + branch br \ tag \ - tr tree \ - ug unstage \ - up update + add \ + remove rm \ + revert rv \ + commit ci \ + cherrypick cy \ + backout bo \ + rebase rb \ + histedit he \ + integrate ig \ + stage sg \ + unstage ug \ + cat \ + info + #+end_src diff --git a/completions/man.org b/completions/man.org index f281654..d90dea3 100644 --- a/completions/man.org +++ b/completions/man.org @@ -1 +1,19 @@ #+TITLE: Completions: man + +** Leven 1 + +Completions for man pages are found via: + +#+begin_src shell + MANPATH=/usr/share/man man -k Nm~. | cut -d\( -f1 | tr -d , | \ + sort | \ + uniq > $MAN_CACH +#+end_src + +Currently the cache is never re-created. Operating without a cache causes +significant load times. If one requires the cache to be refreshed they can run +the following in ~.xsession~ or similar: + +#+begin_src shell +rm -f ${LOAD_PATH}/cache/man +#+end_src diff --git a/completions/mpc.ksh b/completions/mpc.ksh index 8422eac..0aeb180 100755 --- a/completions/mpc.ksh +++ b/completions/mpc.ksh @@ -18,7 +18,8 @@ set -A complete_mpc_1 -- \ toggle toggleoutput \ update \ version volume \ - waitmessage \ + waitmessage + pgrep -fq '/usr/local/sbin/mpd' if [ $? = 0 ]; then set -A complete_mpc_2 -- $(mpc lsplaylists | sort) diff --git a/completions/mpc.org b/completions/mpc.org index 487bb05..95cddb4 100644 --- a/completions/mpc.org +++ b/completions/mpc.org @@ -1 +1,36 @@ #+TITLE: Completions: mpc + +** Level 1 + +The following completions are available for level one on MPC. + +#+begin_src shell + add \ + cdprev channels clear clearerror \ + consume crop crossfade current \ + del disable \ + enable \ + find findadd \ + idle idleloop insert \ + list listall load ls lsplaylists \ + mixrampdb mixrampdelay move \ + next \ + outputs outputset \ + pause pause-if-playing play playlist prev prio \ + random repeat replaygain rescan rm \ + save search searchadd searchplay seek \ + sendmessage shuffle single stats \ + sticker stop subscribe \ + toggle toggleoutput \ + update \ + version volume \ + waitmessage +#+end_src + +** Level 2 + +#+begin_src shell + set -A complete_mpc_2 -- $(mpc lsplaylists | sort) +#+end_src + +*Note:* Level 2 is only populated if ~mpd~ is running. diff --git a/completions/rc.org b/completions/rc.org index 47cfe02..b9ef130 100644 --- a/completions/rc.org +++ b/completions/rc.org @@ -1 +1,13 @@ #+TITLE: Completions: rc + +** Level 1 + +#+begin_src shell +disable enable get ls order set restart start stop +#+end_src + +** Level 2 + +#+begin_src shell +$(rcctl ls all) +#+end_src diff --git a/completions/ssh.org b/completions/ssh.org index d0ace08..2a586f6 100644 --- a/completions/ssh.org +++ b/completions/ssh.org @@ -1 +1,10 @@ #+TITLE: Completions: ssh + +** All Levels + +#+begin_src shell +${HOST_LIST[*]} +#+end_src + +~HOST_LIST~ is a combination of ~/etc/ssh/ssh_known_hosts~ and +~~/.ssh/known_hosts~. diff --git a/completions/vmd.org b/completions/vmd.org index c0c4cdd..1663331 100644 --- a/completions/vmd.org +++ b/completions/vmd.org @@ -1 +1,17 @@ #+TITLE: Completions: vmd + +*Note:* Completions are only loaded if ~vmd~ is running. + +** Level 1 + +#+begin_src shell +console load reload start stop reset status send receive +#+end_src + +** All Levels + +#+begin_src shell +$(vmctl status | awk '!/NAME/{print $NF}') +#+end_src + +