x-plane-env: Add rudimentary zsh completion

master
Michael Raitza 2022-06-12 14:21:04 +02:00
parent bf05a3fc05
commit 1e4348a775
2 changed files with 18 additions and 1 deletions

View File

@ -195,17 +195,24 @@ in buildFHSUserEnv rec {
[ stdenv.cc.cc.lib curl openssl ] ++
# For fly with lua
[ freeglut libudev ]);
extraBuildCommands = ''
chmod u+w $out/etc
mkdir $out/etc/openal
chmod u-w $out/etc
echo "drivers=pulse" > $out/etc/openal/alsoft.conf
mkdir $out/xplane-extra
mkdir -p $out/xplane-extra
'' + (concatMapStrings (addon:
optionalString (addon.passthru ? build) ''
ADDONPATH=${addon}
printf "Addon ${addon.pname}\n" >&2
${addon.passthru.build}
'') uniqueAddons);
extraInstallCommands = ''
mkdir -p $out/share/zsh/site-functions
ln -s ${./x-plane-env.zcomp} $out/share/zsh/site-functions/_x-plane-env
'';
inherit runScript;
}

10
x-plane/x-plane-env.zcomp Normal file
View File

@ -0,0 +1,10 @@
#compdef x-plane-env
_x-plane-env() {
local descr ret=1
local -a context line state state_descr
local -A opt_args
_arguments : '--help:' \
'1:action:(X-Plane Airfoil Plane Installer SHELL prepare ortho revert navdata)'
}