aboutsummaryrefslogtreecommitdiff
path: root/extra/yash
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2021-05-04 22:45:14 +0300
committerCem Keylan <cem@ckyln.com>2021-05-04 22:45:14 +0300
commit4585a016fb5c287f8bb58efcfb7dc05439de5819 (patch)
tree84921e8d291c1c3d883d925e01635c4e47690dec /extra/yash
parent196c7ef6f49601e7a0fb68d70a8cfba801baea29 (diff)
downloadrepository-4585a016fb5c287f8bb58efcfb7dc05439de5819.tar.gz
yash: completion changes
Diffstat (limited to 'extra/yash')
-rwxr-xr-xextra/yash/build2
-rw-r--r--extra/yash/checksums2
-rw-r--r--extra/yash/files/doas42
-rw-r--r--extra/yash/patches/neatvi-completion.patch15
-rw-r--r--extra/yash/sources2
5 files changed, 63 insertions, 0 deletions
diff --git a/extra/yash/build b/extra/yash/build
index b70f863b..d01449fa 100755
--- a/extra/yash/build
+++ b/extra/yash/build
@@ -2,6 +2,8 @@
export LDFLAGS="$LDFLAGS -static"
+patch -p1 < neatvi-completion.patch
+
./configure \
--prefix=/usr \
--enable-help \
diff --git a/extra/yash/checksums b/extra/yash/checksums
index 29675a7e..e1c275b9 100644
--- a/extra/yash/checksums
+++ b/extra/yash/checksums
@@ -1 +1,3 @@
6f15e68eeb63fd42e91c3ce75eccf325f2c938fa1dc248e7213af37c043aeaf8 yash-2.51.tar.xz
+318d93c763e560bb2201e06eb2d9c290d0996b962463ef06965a4002d860abdc doas
+32f8e38ce72d179e207bda071f0a4fd4986cc770ccdb0da7b3b33d903cda403e neatvi-completion.patch
diff --git a/extra/yash/files/doas b/extra/yash/files/doas
new file mode 100644
index 00000000..ffe41bbc
--- /dev/null
+++ b/extra/yash/files/doas
@@ -0,0 +1,42 @@
+# Completion script for the "doas" command.
+function completion/doas {
+
+ typeset OPTIONS ARGOPT PREFIX
+ OPTIONS=( #>#
+ "C:; specify the config file to parse and check its contents"
+ "L; Clear any persisted authorizations from previous invocations"
+ "n; Non interactive mode, fail if doas would prompt for password"
+ "s; run \$SHELL"
+ "u:; specify the user to change to"
+ ) #<#
+
+ command -f completion//parseoptions
+ case $ARGOPT in
+ (-)
+ command -f completion//completeoptions
+ ;;
+ (C)
+ complete -P "$PREFIX" -f
+ ;;
+ (u)
+ complete -P "$PREFIX" -u
+ ;;
+ ('')
+ typeset i=2 edit=false
+ while [ $i -le ${WORDS[#]} ]; do
+ case ${WORDS[i]} in
+ (--) break;;
+ (-e) edit=true;;
+ esac
+ i=$((i+1))
+ done
+ if $edit; then
+ complete -P "$PREFIX" -f
+ else
+ command -f completion//getoperands
+ command -f completion//reexecute
+ fi
+ ;;
+ esac
+
+}
diff --git a/extra/yash/patches/neatvi-completion.patch b/extra/yash/patches/neatvi-completion.patch
new file mode 100644
index 00000000..795fd6b6
--- /dev/null
+++ b/extra/yash/patches/neatvi-completion.patch
@@ -0,0 +1,15 @@
+Neatvi doesn't support parsing flags and it will open the editor immediately,
+so we don't actually want this check performed.
+--- yash-orig/share/completion/ex 2020-12-10 16:40:05.000000000 +0300
++++ yash/share/completion/ex 2021-05-04 22:12:17.299050403 +0300
+@@ -6,10 +6,6 @@
+
+ function completion/ex {
+
+- case $("${WORDS[1]}" --version 2>/dev/null) in (VIM*)
+- command -f completion//reexecute vim
+- return
+- esac
+ typeset type="$(uname 2>/dev/null)"
+
+ typeset OPTIONS POSIXOPTIONS ADDOPTIONS ARGOPT PREFIX
diff --git a/extra/yash/sources b/extra/yash/sources
index 8da8cf85..d3a9279a 100644
--- a/extra/yash/sources
+++ b/extra/yash/sources
@@ -1 +1,3 @@
https://github.com/magicant/yash/releases/download/2.51/yash-2.51.tar.xz
+files/doas share/completion
+patches/neatvi-completion.patch