Skip to content

Instantly share code, notes, and snippets.

@tamadamas
Created March 19, 2025 19:04
Show Gist options
  • Save tamadamas/2131399a653b374666d23480b6daf322 to your computer and use it in GitHub Desktop.
Save tamadamas/2131399a653b374666d23480b6daf322 to your computer and use it in GitHub Desktop.
Zig function fish wrapper
function zz -d "Simple Zig wrapper function"
set -l cmd $argv[1]
set -e argv[1]
switch "$cmd"
case test
zig build -fincremental test
case lint
zig build -fincremental lint
case run
zig build -fincremental run
case debug
zig build -fincremental -Doptimize=Debug --verbose --summary all
case android
zig build -Doptimize=ReleaseFast -Dtarget=aarch64-linux-musl
case build
zig build $argv
case help
echo "Usage: zz [command] [args]"
echo ""
echo "Commands:"
echo " test - Run tests with incremental compilation"
echo " lint - Run linter with incremental compilation"
echo " run - Run the application with incremental compilation"
echo " debug - Build in debug mode with verbose output"
echo " android - Build for aarch64-linux-musl with ReleaseFast"
echo " build - Run zig build with args"
echo " [other] - Pass directly to zig"
echo " help - Show this help"
case "*"
# Default: pass to zig directly
zig $cmd $argv
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment