From d16e3a6cf5569a127b892117931aa2066c7af65c Mon Sep 17 00:00:00 2001 From: Andrew Donnellan Date: Mon, 15 Dec 2025 14:16:58 +1100 Subject: tools/create-image.sh: improve help message Improve the help message: - sort options alphabetically - print default values - print first line to stdout like the rest of the message - fix typos, improve style Also sort the options parsing to be alphabetical (except --help), and use spaces consistently for indentation in this section. Signed-off-by: Andrew Donnellan --- tools/create-image.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/create-image.sh b/tools/create-image.sh index 8118ef79b..a760ff9d1 100755 --- a/tools/create-image.sh +++ b/tools/create-image.sh @@ -23,21 +23,21 @@ PERF=false # Display help function display_help() { - echo "Usage: $0 [option...] " >&2 + echo "Usage: $0 [option...] " echo - echo " -a, --arch Set architecture" - echo " -d, --distribution Set on which debian distribution to create" - echo " -f, --feature Check what packages to install in the image, options are minimal, full" - echo " -s, --seek Image size (MB), default 2048 (2G)" + echo " -a, --arch Set architecture (default: $ARCH)" + echo " -d, --distribution Set on which Debian distribution to create (default: $RELEASE)" + echo " -f, --feature Check what packages to install in the image, options are minimal, full (default: $FEATURE)" echo " -h, --help Display help message" - echo " -p, --add-perf Add perf support with this option enabled. Please set envrionment variable \$KERNEL at first" + echo " -p, --add-perf Add perf support. Requires environment variable \$KERNEL pointing to kernel source tree" + echo " -s, --seek Image size in MB (default: $(($SEEK + 1)))" echo } while true; do if [ $# -eq 0 ];then - echo $# - break + echo $# + break fi case "$1" in -h | --help) @@ -45,25 +45,25 @@ while true; do exit 0 ;; -a | --arch) - ARCH=$2 + ARCH=$2 shift 2 ;; -d | --distribution) - RELEASE=$2 + RELEASE=$2 shift 2 ;; -f | --feature) - FEATURE=$2 - shift 2 - ;; - -s | --seek) - SEEK=$(($2 - 1)) + FEATURE=$2 shift 2 ;; -p | --add-perf) - PERF=true + PERF=true shift 1 ;; + -s | --seek) + SEEK=$(($2 - 1)) + shift 2 + ;; -*) echo "Error: Unknown option: $1" >&2 exit 1 -- cgit mrf-deployment