summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-12 15:46:35 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-12 16:23:50 +0200
commitc82cb4f416c184954f4e3429288a41a4f53b4089 (patch)
tree77debae4201a133292a33ef5f66c70cffc759bbc
parent686f0c1a238b62e17a1c376b12895068efb04281 (diff)
downloadalpine-conf-c82cb4f416c184954f4e3429288a41a4f53b4089.zip
update-kernel: fix usage help text
send it to stdout with -h
-rw-r--r--update-kernel.in17
1 files changed, 10 insertions, 7 deletions
diff --git a/update-kernel.in b/update-kernel.in
index a995de5..85dcb17 100644
--- a/update-kernel.in
+++ b/update-kernel.in
@@ -9,7 +9,8 @@
# Copyright (c) 2014-2021 Kaarle Ritvanen
PREFIX=@PREFIX@
-. $PREFIX/lib/libalpine.sh
+: ${LIBDIR=$PREFIX/lib}
+. "$LIBDIR/libalpine.sh"
SCRIPT=update-kernel
VIRTUAL=.tmp-$SCRIPT
@@ -39,14 +40,16 @@ error() {
}
usage() {
- [ "$2" ] && error "$2"
+ [ "$2" ] && error "$2" $outfh
local opts="[-F <feature>]... [-p <package>]..."
local dest_args="[-a <arch>] <dest_dir>"
- cat >&2 <<-__EOF__
+ local outfh=2
+ [ $1 -eq 0 ] && outfh=1
+ cat >&$outfh <<-__EOF__
- Syntax: $SCRIPT $opts [$dest_args]
- $SCRIPT -f <flavor> $opts $dest_args
- $SCRIPT -b <build_dir> $opts [$dest_args]
+ usage: $SCRIPT $opts [$dest_args]
+ $SCRIPT -f <flavor> $opts $dest_args
+ $SCRIPT -b <build_dir> $opts [$dest_args]
Options: -a|--arch <arch> Install kernel for specified architecture
-b|--build-dir <dir> Install custom-built kernel
@@ -98,7 +101,7 @@ while :; do
modloopfw="$modloopfw $1"
;;
-h|--help)
- echo "$SCRIPT @VERSION@" >&2
+ echo "$SCRIPT @VERSION@"
usage 0
;;
-p|--package)