From 399207321265307bb15f37d867f9370cd51c82a8 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 18 Jun 2025 16:58:20 +0900 Subject: dist: move comp to dist Signed-off-by: Ophestra --- comp/_fortify | 82 ------------------------------------------------------ dist/comp/_fortify | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ dist/release.sh | 2 +- package.nix | 2 +- 4 files changed, 84 insertions(+), 84 deletions(-) delete mode 100644 comp/_fortify create mode 100644 dist/comp/_fortify diff --git a/comp/_fortify b/comp/_fortify deleted file mode 100644 index 2eeaf845..00000000 --- a/comp/_fortify +++ /dev/null @@ -1,82 +0,0 @@ -#compdef fortify - -_fortify_app() { - __fortify_files - return $? -} - -_fortify_run() { - _arguments \ - '--id[Reverse-DNS style Application identifier, leave empty to inherit instance identifier]:id' \ - '-a[Application identity]: :_numbers' \ - '-g[Groups inherited by all container processes]: :_groups' \ - '-d[Container home directory]: :_files -/' \ - '-u[Passwd user name within sandbox]: :_users' \ - '--wayland[Enable connection to Wayland via security-context-v1]' \ - '-X[Enable direct connection to X11]' \ - '--dbus[Enable proxied connection to D-Bus]' \ - '--pulse[Enable direct connection to PulseAudio]' \ - '--dbus-config[Path to session bus proxy config file]: :_files -g "*.json"' \ - '--dbus-system[Path to system bus proxy config file]: :_files -g "*.json"' \ - '--mpris[Allow owning MPRIS D-Bus path]' \ - '--dbus-log[Force buffered logging in the D-Bus proxy]' -} - -_fortify_ps() { - _arguments \ - '--short[List instances only]' -} - -_fortify_show() { - _alternative \ - 'instances:domains:__fortify_instances' \ - 'files:files:__fortify_files' -} - -__fortify_files() { - _files -g "*.(json|ftfy)" - return $? -} - -__fortify_instances() { - local -a out - shift -p - out=( ${(f)"$(_call_program commands fortify ps --short 2>&1)"} ) - if (( $#out == 0 )); then - _message "No active instances" - else - _describe "active instances" out - fi - return $? -} - -(( $+functions[_fortify_commands] )) || _fortify_commands() -{ - local -a _fortify_cmds - _fortify_cmds=( - "app:Launch app defined by the specified config file" - "run:Configure and start a permissive default sandbox" - "show:Show the contents of an app configuration" - "ps:List active apps and their state" - "version:Show fortify version" - "license:Show full license text" - "template:Produce a config template" - "help:Show help message" - ) - if (( CURRENT == 1 )); then - _describe -t commands 'action' _fortify_cmds || compadd "$@" - else - local curcontext="$curcontext" - cmd="${${_fortify_cmds[(r)$words[1]:*]%%:*}}" - if (( $+functions[_fortify_$cmd] )); then - _fortify_$cmd - else - _message "no more options" - fi - fi -} - -_arguments -C \ - '-v[Verbose output]' \ - '--json[Serialise output in JSON when applicable]' \ - '*::fortify command:_fortify_commands' \ No newline at end of file diff --git a/dist/comp/_fortify b/dist/comp/_fortify new file mode 100644 index 00000000..2eeaf845 --- /dev/null +++ b/dist/comp/_fortify @@ -0,0 +1,82 @@ +#compdef fortify + +_fortify_app() { + __fortify_files + return $? +} + +_fortify_run() { + _arguments \ + '--id[Reverse-DNS style Application identifier, leave empty to inherit instance identifier]:id' \ + '-a[Application identity]: :_numbers' \ + '-g[Groups inherited by all container processes]: :_groups' \ + '-d[Container home directory]: :_files -/' \ + '-u[Passwd user name within sandbox]: :_users' \ + '--wayland[Enable connection to Wayland via security-context-v1]' \ + '-X[Enable direct connection to X11]' \ + '--dbus[Enable proxied connection to D-Bus]' \ + '--pulse[Enable direct connection to PulseAudio]' \ + '--dbus-config[Path to session bus proxy config file]: :_files -g "*.json"' \ + '--dbus-system[Path to system bus proxy config file]: :_files -g "*.json"' \ + '--mpris[Allow owning MPRIS D-Bus path]' \ + '--dbus-log[Force buffered logging in the D-Bus proxy]' +} + +_fortify_ps() { + _arguments \ + '--short[List instances only]' +} + +_fortify_show() { + _alternative \ + 'instances:domains:__fortify_instances' \ + 'files:files:__fortify_files' +} + +__fortify_files() { + _files -g "*.(json|ftfy)" + return $? +} + +__fortify_instances() { + local -a out + shift -p + out=( ${(f)"$(_call_program commands fortify ps --short 2>&1)"} ) + if (( $#out == 0 )); then + _message "No active instances" + else + _describe "active instances" out + fi + return $? +} + +(( $+functions[_fortify_commands] )) || _fortify_commands() +{ + local -a _fortify_cmds + _fortify_cmds=( + "app:Launch app defined by the specified config file" + "run:Configure and start a permissive default sandbox" + "show:Show the contents of an app configuration" + "ps:List active apps and their state" + "version:Show fortify version" + "license:Show full license text" + "template:Produce a config template" + "help:Show help message" + ) + if (( CURRENT == 1 )); then + _describe -t commands 'action' _fortify_cmds || compadd "$@" + else + local curcontext="$curcontext" + cmd="${${_fortify_cmds[(r)$words[1]:*]%%:*}}" + if (( $+functions[_fortify_$cmd] )); then + _fortify_$cmd + else + _message "no more options" + fi + fi +} + +_arguments -C \ + '-v[Verbose output]' \ + '--json[Serialise output in JSON when applicable]' \ + '*::fortify command:_fortify_commands' \ No newline at end of file diff --git a/dist/release.sh b/dist/release.sh index 02f15411..a50c6614 100755 --- a/dist/release.sh +++ b/dist/release.sh @@ -6,7 +6,7 @@ out="dist/${pname}" mkdir -p "${out}" cp -v "README.md" "dist/fsurc.default" "dist/install.sh" "${out}" -cp -rv "comp" "${out}" +cp -rv "dist/comp" "${out}" go generate ./... go build -trimpath -v -o "${out}/bin/" -ldflags "-s -w -buildid= -extldflags '-static' diff --git a/package.nix b/package.nix index 57a77112..128b18c6 100644 --- a/package.nix +++ b/package.nix @@ -108,7 +108,7 @@ buildGoModule rec { ]; in '' - install -D --target-directory=$out/share/zsh/site-functions comp/* + install -D --target-directory=$out/share/zsh/site-functions dist/comp/* mkdir "$out/libexec" mv "$out"/bin/* "$out/libexec/" -- cgit v1.3.1