From cea680b7276c705be53b3a8cdccd2e8ecd39c3ae Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 21 May 2025 16:38:39 +0000 Subject: [PATCH] scripts/deploy: fix --help flag --- scripts/deploy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/deploy b/scripts/deploy index e8296428a..3568f0aa7 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -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