From 0bcabfa886e6aa88f4ba891c35bc30a04e64343f Mon Sep 17 00:00:00 2001 From: Evgeny Egorochkin Date: Tue, 6 Aug 2013 18:56:10 +0300 Subject: [PATCH] nixos-checkout: fix output if ran with no options, -h and --help. Other options will still trigger mkdir output :( --- modules/installer/tools/nixos-checkout.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/installer/tools/nixos-checkout.nix b/modules/installer/tools/nixos-checkout.nix index 7cf395145d2c..4859a454448c 100644 --- a/modules/installer/tools/nixos-checkout.nix +++ b/modules/installer/tools/nixos-checkout.nix @@ -15,7 +15,12 @@ let src = pkgs.writeScript "nixos-checkout" '' #! ${pkgs.stdenv.shell} -e - + + if [ -z "$1" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ]; then + echo "Usage: `basename $0` PREFIX. See NixOS Manual for more info." + exit 0 + fi + prefix="$1" if [ -z "$prefix" ]; then prefix=/etc/nixos; fi mkdir -p "$prefix"