Skip to content

Commit

Permalink
Merge pull request #34 from PatrickDaG/main
Browse files Browse the repository at this point in the history
fix: Actually print subcommand help
  • Loading branch information
oddlama authored Jul 15, 2024
2 parents c071067 + 269b1a6 commit d638987
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ writeShellScriptBin "agenix" ''
while [[ $# -gt 0 ]]; do
case "$1" in
"help"|"--help"|"-help"|"-h")
show_help
exit 1
if [[ "$APP" == "" ]]; then
show_help
exit 1
else
PASS_THRU_ARGS+=("$1")
shift
fi
;;
"--show-trace")
# It is potentially desirable to use --show-trace in the subcommand as
Expand All @@ -76,7 +81,8 @@ writeShellScriptBin "agenix" ''
esac
done
if [[ "$APP" == "" ]]; then
die "Error: No app provided. Exiting."
show_help
exit 1
fi
echo "Collecting information about hosts. This may take a while..."
exec nix run $SHOW_TRACE_ARG \
Expand Down

0 comments on commit d638987

Please sign in to comment.