diff options
| author | Andrew Donnellan <ajd@linux.ibm.com> | 2025-12-15 14:16:58 +1100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-12-18 10:02:13 +0000 |
| commit | d16e3a6cf5569a127b892117931aa2066c7af65c (patch) | |
| tree | 8295e496f3704a2e8e79ebfb2c5713d91a8e85a4 /tools | |
| parent | d6d0fdea2c73e60b713a40cca9adfd9aebe5cd0d (diff) | |
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 <ajd@linux.ibm.com>
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/create-image.sh | 32 |
1 files 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 |
