scripts/deploy: fix --help flag

This commit is contained in:
2025-05-21 16:38:39 +00:00
parent 61fb2666d0
commit cea680b727

View File

@@ -9,7 +9,7 @@ const SELF = $(hostname)
var DRY_RUN = false
var NIX_ARGS = [] # extra args to pass to nix invocations
proc usage {
proc usage (;; status=1) {
echo "deploy: deploy a nix config to a remote machine, possibly activating it"
echo ""
echo "usage: deploy [options] [host] [host2 ...]"
@@ -34,7 +34,7 @@ proc usage {
echo "- deploy --pre: build and copy all hosts"
echo "- deploy desko lappy: build and deploy just those hosts"
echo "- deploy: deploy the local host"
exit 1
exit "$status"
}
proc info (...plain; ...escape) {
@@ -316,6 +316,10 @@ proc deployOneHost (; nixcfg) {
proc main (...args) {
var cli = parseArgs (...args)
if (cli.help) {
usage (status=0)
}
setglobal NIX_ARGS = cli.unhandled;
if (cli.dryRun) {
setglobal DRY_RUN = true