summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-11 14:12:36 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-13 17:35:55 +0200
commitef72fcc2aa099fad9020c2bb95118e8eea2e9153 (patch)
tree5e67073102f9fe2183c4af15751bb335599e9093 /nixos/modules/installer
parenta042d9129008d0a929d2541e70b5553d9dad2588 (diff)
downloadnixlib-ef72fcc2aa099fad9020c2bb95118e8eea2e9153.tar
nixlib-ef72fcc2aa099fad9020c2bb95118e8eea2e9153.tar.gz
nixlib-ef72fcc2aa099fad9020c2bb95118e8eea2e9153.tar.bz2
nixlib-ef72fcc2aa099fad9020c2bb95118e8eea2e9153.tar.lz
nixlib-ef72fcc2aa099fad9020c2bb95118e8eea2e9153.tar.xz
nixlib-ef72fcc2aa099fad9020c2bb95118e8eea2e9153.tar.zst
nixlib-ef72fcc2aa099fad9020c2bb95118e8eea2e9153.zip
Map --help flag to "man <command>" for more NixOS commands
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/tools/nixos-build-vms/nixos-build-vms.sh11
-rw-r--r--nixos/modules/installer/tools/nixos-install.sh22
-rw-r--r--nixos/modules/installer/tools/nixos-option.sh32
3 files changed, 18 insertions, 47 deletions
diff --git a/nixos/modules/installer/tools/nixos-build-vms/nixos-build-vms.sh b/nixos/modules/installer/tools/nixos-build-vms/nixos-build-vms.sh
index 0a6e8b920a11..f9cbfffde704 100644
--- a/nixos/modules/installer/tools/nixos-build-vms/nixos-build-vms.sh
+++ b/nixos/modules/installer/tools/nixos-build-vms/nixos-build-vms.sh
@@ -2,14 +2,9 @@
 
 # Shows the usage of this command to the user
 
-showUsage()
-{
-    echo "Usage: $0 network_expr"
-    echo "Options:"
-    echo
-    echo "--no-out-link   Do not create a 'result' symlink"
-    echo "--show-trace    Shows the output trace"
-    echo "-h,--help       Shows the usage of this command"
+showUsage() {
+    exec man nixos-build-vms
+    exit 1
 }
 
 # Parse valid argument options
diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh
index 19ce81983f15..126d5b185e81 100644
--- a/nixos/modules/installer/tools/nixos-install.sh
+++ b/nixos/modules/installer/tools/nixos-install.sh
@@ -14,15 +14,19 @@ extraBuildFlags=()
 while [ "$#" -gt 0 ]; do
     i="$1"; shift 1
     case "$i" in
-      -I)
-        given_path="$1"; shift 1
-        absolute_path=$(readlink -m $given_path)
-        extraBuildFlags+=("$i" "/mnt$absolute_path")
-        ;;
-      *)
-        echo "$0: unknown option \`$i'"
-        exit 1
-        ;;
+        -I)
+            given_path="$1"; shift 1
+            absolute_path=$(readlink -m $given_path)
+            extraBuildFlags+=("$i" "/mnt$absolute_path")
+            ;;
+        --help)
+            exec man nixos-install
+            exit 1
+            ;;
+        *)
+            echo "$0: unknown option \`$i'"
+            exit 1
+            ;;
     esac
 done
 
diff --git a/nixos/modules/installer/tools/nixos-option.sh b/nixos/modules/installer/tools/nixos-option.sh
index 7f008d62c249..45499988f266 100644
--- a/nixos/modules/installer/tools/nixos-option.sh
+++ b/nixos/modules/installer/tools/nixos-option.sh
@@ -8,36 +8,8 @@
 export NIXOS_CONFIG
 
 usage () {
-  echo 1>&2 "
-Usage: $0 [-v] [-d] [-l] [--xml] OPTION_NAME
-       $0 --install
-
-This program allows you to inspect the current value of NixOS
-configuration options.  It can also generate a basic NixOS
-configuration file.
-
-Options:
-
-  -i | --install        Write a template NixOS configuration file to
-                        ${mountPoint:+$mountPoint/}$NIXOS_CONFIG.
-  -v | --value          Display the current value, based on your
-                        configuration.
-  -d | --description    Display the default value, the example and the
-                        description.
-  -l | --lookup         Display where the option is defined and where it
-                        is declared.
-  --xml                 Print an XML representation of the result.
-                        Implies -vdl options.
-  --help                Show this message.
-
-Environment variables affecting $0:
-
-  \$mountPoint          Path to the target file system.
-  \$NIXOS_CONFIG        Path to your configuration file.
-
-"
-
-  exit 1;
+    exec man nixos-rebuild
+    exit 1
 }
 
 #####################