yay.nix/functions/yay.fish
2025-04-27 15:53:13 -04:00

34 lines
No EOL
870 B
Fish

#!/usr/bin/env fish
function yay_function
# Main dispatch
if test (count $argv) -eq 0
echo "yay! :D"
echo "Usage: yay <command> [args]"
echo "Commands: rebuild, update, garbage, try, tar, untar"
exit 1
end
switch $argv[1]
case rebuild
__yay_rebuild $argv[2..-1]; or exit $status
case update
__yay_update $argv[2..-1]; or exit $status
case garbage
__yay_garbage; or exit $status
case try
__yay_try $argv[2..-1]; or exit $status
case tar
__yay_tar $argv[2..-1]; or exit $status
case untar
__yay_untar $argv[2..-1]; or exit $status
case '*'
__yay_red "Unknown subcommand: $argv[1]"
exit 1
end
end
# For direct fish shell usage
function yay
yay_function $argv
end