diff options
Diffstat (limited to 'test/fallback')
56 files changed, 140 insertions, 0 deletions
diff --git a/test/fallback/Makefile.am b/test/fallback/Makefile.am new file mode 100644 index 0000000..096a196 --- /dev/null +++ b/test/fallback/Makefile.am @@ -0,0 +1,7 @@ +SUBDIRS = completions + +EXTRA_DIST = \ + update-fallback-links + +update: + ./update-fallback-links diff --git a/test/fallback/completions/Makefile.am b/test/fallback/completions/Makefile.am new file mode 100644 index 0000000..8efc9cc --- /dev/null +++ b/test/fallback/completions/Makefile.am @@ -0,0 +1,53 @@ +EXTRA_DIST = \ + adb \ + cal \ + cargo \ + chfn \ + chsh \ + dmesg \ + eject \ + flamegraph \ + gaiacli \ + gh \ + golangci-lint \ + gsctl \ + hexdump \ + hwclock \ + ionice \ + jungle \ + keyring \ + kontena \ + look \ + mdbook \ + mock \ + modules \ + mount \ + mount.linux \ + newgrp \ + nmcli \ + nox \ + nvm \ + pip \ + pipenv \ + renice \ + repomanage \ + reptyr \ + rfkill \ + rtcwake \ + ruff \ + runuser \ + rustup \ + slackpkg \ + su \ + svn \ + svnadmin \ + svnlook \ + tokio-console \ + udevadm \ + umount \ + umount.linux \ + vault \ + write \ + xm \ + yq \ + yum diff --git a/test/fallback/completions/README.md b/test/fallback/completions/README.md new file mode 100644 index 0000000..020e4b2 --- /dev/null +++ b/test/fallback/completions/README.md @@ -0,0 +1,8 @@ +# test/fallback/completions + +This directory should contain a non-underscore prefixed symlink to +corresponding underscore prefixed, fallback completions we have in the tree. + +The test suite sets up loading of completions so that this dir is preferred +over system install locations, in order to test our fallback in-tree +completions over possibly installed non-fallback out-of-tree ones. diff --git a/test/fallback/completions/adb b/test/fallback/completions/adb new file mode 120000 index 0000000..66ed7eb --- /dev/null +++ b/test/fallback/completions/adb @@ -0,0 +1 @@ +../../../completions/_adb
\ No newline at end of file diff --git a/test/fallback/completions/cal b/test/fallback/completions/cal new file mode 120000 index 0000000..733c95d --- /dev/null +++ b/test/fallback/completions/cal @@ -0,0 +1 @@ +../../../completions/_cal
\ No newline at end of file diff --git a/test/fallback/completions/cargo b/test/fallback/completions/cargo new file mode 120000 index 0000000..cdc7c30 --- /dev/null +++ b/test/fallback/completions/cargo @@ -0,0 +1 @@ +../../../completions/_cargo
\ No newline at end of file diff --git a/test/fallback/completions/chfn b/test/fallback/completions/chfn new file mode 120000 index 0000000..dc7726d --- /dev/null +++ b/test/fallback/completions/chfn @@ -0,0 +1 @@ +../../../completions/_chfn
\ No newline at end of file diff --git a/test/fallback/completions/chsh b/test/fallback/completions/chsh new file mode 120000 index 0000000..e99eb81 --- /dev/null +++ b/test/fallback/completions/chsh @@ -0,0 +1 @@ +../../../completions/_chsh
\ No newline at end of file diff --git a/test/fallback/completions/dmesg b/test/fallback/completions/dmesg new file mode 120000 index 0000000..b41aa72 --- /dev/null +++ b/test/fallback/completions/dmesg @@ -0,0 +1 @@ +../../../completions/_dmesg
\ No newline at end of file diff --git a/test/fallback/completions/eject b/test/fallback/completions/eject new file mode 120000 index 0000000..1992645 --- /dev/null +++ b/test/fallback/completions/eject @@ -0,0 +1 @@ +../../../completions/_eject
\ No newline at end of file diff --git a/test/fallback/completions/flamegraph b/test/fallback/completions/flamegraph new file mode 120000 index 0000000..3b06327 --- /dev/null +++ b/test/fallback/completions/flamegraph @@ -0,0 +1 @@ +../../../completions/_flamegraph
\ No newline at end of file diff --git a/test/fallback/completions/gaiacli b/test/fallback/completions/gaiacli new file mode 120000 index 0000000..4b13535 --- /dev/null +++ b/test/fallback/completions/gaiacli @@ -0,0 +1 @@ +../../../completions/_gaiacli
\ No newline at end of file diff --git a/test/fallback/completions/gh b/test/fallback/completions/gh new file mode 120000 index 0000000..823628f --- /dev/null +++ b/test/fallback/completions/gh @@ -0,0 +1 @@ +../../../completions/_gh
\ No newline at end of file diff --git a/test/fallback/completions/golangci-lint b/test/fallback/completions/golangci-lint new file mode 120000 index 0000000..b0fa4ef --- /dev/null +++ b/test/fallback/completions/golangci-lint @@ -0,0 +1 @@ +../../../completions/_golangci-lint
\ No newline at end of file diff --git a/test/fallback/completions/gsctl b/test/fallback/completions/gsctl new file mode 120000 index 0000000..e351e86 --- /dev/null +++ b/test/fallback/completions/gsctl @@ -0,0 +1 @@ +../../../completions/_gsctl
\ No newline at end of file diff --git a/test/fallback/completions/hexdump b/test/fallback/completions/hexdump new file mode 120000 index 0000000..90708a0 --- /dev/null +++ b/test/fallback/completions/hexdump @@ -0,0 +1 @@ +../../../completions/_hexdump
\ No newline at end of file diff --git a/test/fallback/completions/hwclock b/test/fallback/completions/hwclock new file mode 120000 index 0000000..7cb778e --- /dev/null +++ b/test/fallback/completions/hwclock @@ -0,0 +1 @@ +../../../completions/_hwclock
\ No newline at end of file diff --git a/test/fallback/completions/ionice b/test/fallback/completions/ionice new file mode 120000 index 0000000..4861309 --- /dev/null +++ b/test/fallback/completions/ionice @@ -0,0 +1 @@ +../../../completions/_ionice
\ No newline at end of file diff --git a/test/fallback/completions/jungle b/test/fallback/completions/jungle new file mode 120000 index 0000000..e9069c2 --- /dev/null +++ b/test/fallback/completions/jungle @@ -0,0 +1 @@ +../../../completions/_jungle
\ No newline at end of file diff --git a/test/fallback/completions/keyring b/test/fallback/completions/keyring new file mode 120000 index 0000000..354980b --- /dev/null +++ b/test/fallback/completions/keyring @@ -0,0 +1 @@ +../../../completions/_keyring
\ No newline at end of file diff --git a/test/fallback/completions/kontena b/test/fallback/completions/kontena new file mode 120000 index 0000000..ceeb17d --- /dev/null +++ b/test/fallback/completions/kontena @@ -0,0 +1 @@ +../../../completions/_kontena
\ No newline at end of file diff --git a/test/fallback/completions/look b/test/fallback/completions/look new file mode 120000 index 0000000..f59ed26 --- /dev/null +++ b/test/fallback/completions/look @@ -0,0 +1 @@ +../../../completions/_look
\ No newline at end of file diff --git a/test/fallback/completions/mdbook b/test/fallback/completions/mdbook new file mode 120000 index 0000000..70a0f1d --- /dev/null +++ b/test/fallback/completions/mdbook @@ -0,0 +1 @@ +../../../completions/_mdbook
\ No newline at end of file diff --git a/test/fallback/completions/mock b/test/fallback/completions/mock new file mode 120000 index 0000000..9a7a69a --- /dev/null +++ b/test/fallback/completions/mock @@ -0,0 +1 @@ +../../../completions/_mock
\ No newline at end of file diff --git a/test/fallback/completions/modules b/test/fallback/completions/modules new file mode 120000 index 0000000..c3fa5e2 --- /dev/null +++ b/test/fallback/completions/modules @@ -0,0 +1 @@ +../../../completions/_modules
\ No newline at end of file diff --git a/test/fallback/completions/mount b/test/fallback/completions/mount new file mode 120000 index 0000000..84a65f1 --- /dev/null +++ b/test/fallback/completions/mount @@ -0,0 +1 @@ +../../../completions/_mount
\ No newline at end of file diff --git a/test/fallback/completions/mount.linux b/test/fallback/completions/mount.linux new file mode 120000 index 0000000..216ae8a --- /dev/null +++ b/test/fallback/completions/mount.linux @@ -0,0 +1 @@ +../../../completions/_mount.linux
\ No newline at end of file diff --git a/test/fallback/completions/newgrp b/test/fallback/completions/newgrp new file mode 120000 index 0000000..cab15d0 --- /dev/null +++ b/test/fallback/completions/newgrp @@ -0,0 +1 @@ +../../../completions/_newgrp
\ No newline at end of file diff --git a/test/fallback/completions/nmcli b/test/fallback/completions/nmcli new file mode 120000 index 0000000..0400cca --- /dev/null +++ b/test/fallback/completions/nmcli @@ -0,0 +1 @@ +../../../completions/_nmcli
\ No newline at end of file diff --git a/test/fallback/completions/nox b/test/fallback/completions/nox new file mode 120000 index 0000000..1ff4f70 --- /dev/null +++ b/test/fallback/completions/nox @@ -0,0 +1 @@ +../../../completions/_nox
\ No newline at end of file diff --git a/test/fallback/completions/nvm b/test/fallback/completions/nvm new file mode 120000 index 0000000..bcaccbb --- /dev/null +++ b/test/fallback/completions/nvm @@ -0,0 +1 @@ +../../../completions/_nvm
\ No newline at end of file diff --git a/test/fallback/completions/pip b/test/fallback/completions/pip new file mode 120000 index 0000000..5fb8a9c --- /dev/null +++ b/test/fallback/completions/pip @@ -0,0 +1 @@ +../../../completions/_pip
\ No newline at end of file diff --git a/test/fallback/completions/pipenv b/test/fallback/completions/pipenv new file mode 120000 index 0000000..faa7ea3 --- /dev/null +++ b/test/fallback/completions/pipenv @@ -0,0 +1 @@ +../../../completions/_pipenv
\ No newline at end of file diff --git a/test/fallback/completions/renice b/test/fallback/completions/renice new file mode 120000 index 0000000..4a62179 --- /dev/null +++ b/test/fallback/completions/renice @@ -0,0 +1 @@ +../../../completions/_renice
\ No newline at end of file diff --git a/test/fallback/completions/repomanage b/test/fallback/completions/repomanage new file mode 120000 index 0000000..b6feb30 --- /dev/null +++ b/test/fallback/completions/repomanage @@ -0,0 +1 @@ +../../../completions/_repomanage
\ No newline at end of file diff --git a/test/fallback/completions/reptyr b/test/fallback/completions/reptyr new file mode 120000 index 0000000..d67c4b5 --- /dev/null +++ b/test/fallback/completions/reptyr @@ -0,0 +1 @@ +../../../completions/_reptyr
\ No newline at end of file diff --git a/test/fallback/completions/rfkill b/test/fallback/completions/rfkill new file mode 120000 index 0000000..6c3c8f6 --- /dev/null +++ b/test/fallback/completions/rfkill @@ -0,0 +1 @@ +../../../completions/_rfkill
\ No newline at end of file diff --git a/test/fallback/completions/rtcwake b/test/fallback/completions/rtcwake new file mode 120000 index 0000000..244c7f1 --- /dev/null +++ b/test/fallback/completions/rtcwake @@ -0,0 +1 @@ +../../../completions/_rtcwake
\ No newline at end of file diff --git a/test/fallback/completions/ruff b/test/fallback/completions/ruff new file mode 120000 index 0000000..2d6104b --- /dev/null +++ b/test/fallback/completions/ruff @@ -0,0 +1 @@ +../../../completions/_ruff
\ No newline at end of file diff --git a/test/fallback/completions/runuser b/test/fallback/completions/runuser new file mode 120000 index 0000000..c3e3422 --- /dev/null +++ b/test/fallback/completions/runuser @@ -0,0 +1 @@ +../../../completions/_runuser
\ No newline at end of file diff --git a/test/fallback/completions/rustup b/test/fallback/completions/rustup new file mode 120000 index 0000000..18b256a --- /dev/null +++ b/test/fallback/completions/rustup @@ -0,0 +1 @@ +../../../completions/_rustup
\ No newline at end of file diff --git a/test/fallback/completions/slackpkg b/test/fallback/completions/slackpkg new file mode 120000 index 0000000..990071a --- /dev/null +++ b/test/fallback/completions/slackpkg @@ -0,0 +1 @@ +../../../completions/_slackpkg
\ No newline at end of file diff --git a/test/fallback/completions/su b/test/fallback/completions/su new file mode 120000 index 0000000..9e972cd --- /dev/null +++ b/test/fallback/completions/su @@ -0,0 +1 @@ +../../../completions/_su
\ No newline at end of file diff --git a/test/fallback/completions/svn b/test/fallback/completions/svn new file mode 120000 index 0000000..0bf5b7f --- /dev/null +++ b/test/fallback/completions/svn @@ -0,0 +1 @@ +../../../completions/_svn
\ No newline at end of file diff --git a/test/fallback/completions/svnadmin b/test/fallback/completions/svnadmin new file mode 120000 index 0000000..90ce5ef --- /dev/null +++ b/test/fallback/completions/svnadmin @@ -0,0 +1 @@ +../../../completions/_svnadmin
\ No newline at end of file diff --git a/test/fallback/completions/svnlook b/test/fallback/completions/svnlook new file mode 120000 index 0000000..efad3dc --- /dev/null +++ b/test/fallback/completions/svnlook @@ -0,0 +1 @@ +../../../completions/_svnlook
\ No newline at end of file diff --git a/test/fallback/completions/tokio-console b/test/fallback/completions/tokio-console new file mode 120000 index 0000000..1fb8249 --- /dev/null +++ b/test/fallback/completions/tokio-console @@ -0,0 +1 @@ +../../../completions/_tokio-console
\ No newline at end of file diff --git a/test/fallback/completions/udevadm b/test/fallback/completions/udevadm new file mode 120000 index 0000000..2498b90 --- /dev/null +++ b/test/fallback/completions/udevadm @@ -0,0 +1 @@ +../../../completions/_udevadm
\ No newline at end of file diff --git a/test/fallback/completions/umount b/test/fallback/completions/umount new file mode 120000 index 0000000..77f661e --- /dev/null +++ b/test/fallback/completions/umount @@ -0,0 +1 @@ +../../../completions/_umount
\ No newline at end of file diff --git a/test/fallback/completions/umount.linux b/test/fallback/completions/umount.linux new file mode 120000 index 0000000..6066bd8 --- /dev/null +++ b/test/fallback/completions/umount.linux @@ -0,0 +1 @@ +../../../completions/_umount.linux
\ No newline at end of file diff --git a/test/fallback/completions/vault b/test/fallback/completions/vault new file mode 120000 index 0000000..abd0ad2 --- /dev/null +++ b/test/fallback/completions/vault @@ -0,0 +1 @@ +../../../completions/_vault
\ No newline at end of file diff --git a/test/fallback/completions/write b/test/fallback/completions/write new file mode 120000 index 0000000..e4d2f2c --- /dev/null +++ b/test/fallback/completions/write @@ -0,0 +1 @@ +../../../completions/_write
\ No newline at end of file diff --git a/test/fallback/completions/xm b/test/fallback/completions/xm new file mode 120000 index 0000000..1fb8840 --- /dev/null +++ b/test/fallback/completions/xm @@ -0,0 +1 @@ +../../../completions/_xm
\ No newline at end of file diff --git a/test/fallback/completions/yq b/test/fallback/completions/yq new file mode 120000 index 0000000..9ea0a28 --- /dev/null +++ b/test/fallback/completions/yq @@ -0,0 +1 @@ +../../../completions/_yq
\ No newline at end of file diff --git a/test/fallback/completions/yum b/test/fallback/completions/yum new file mode 120000 index 0000000..cd8a7ed --- /dev/null +++ b/test/fallback/completions/yum @@ -0,0 +1 @@ +../../../completions/_yum
\ No newline at end of file diff --git a/test/fallback/update-fallback-links b/test/fallback/update-fallback-links new file mode 100755 index 0000000..5da1bcb --- /dev/null +++ b/test/fallback/update-fallback-links @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -euo pipefail + +is_tracked_by_git() +{ + git ls-files --error-unmatch "$1" &>/dev/null +} + +cd "$(dirname "$0")/completions" +for f in *; do + if [[ -L $f ]] && is_tracked_by_git "$f"; then + git rm -f "$f" + fi +done +for f in ../../../completions/_*; do + if is_tracked_by_git "$f"; then + ln -sf "$f" "${f##*/_}" + git add --verbose "${f##*/_}" + fi +done |