From 2e94a86b316a57855faec1039c90dfd651ac3e95 Mon Sep 17 00:00:00 2001 From: Ruslan Mstoi Date: Thu, 16 Feb 2023 17:45:45 +0200 Subject: [PATCH] scripts: dev_cli.sh: print help if command unspecified To improve user friendliness, print help text when no command is given. Signed-off-by: Ruslan Mstoi --- scripts/dev_cli.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/dev_cli.sh b/scripts/dev_cli.sh index 518d4ee01..b36641166 100755 --- a/scripts/dev_cli.sh +++ b/scripts/dev_cli.sh @@ -168,6 +168,7 @@ process_volumes_args() { exported_volumes="$exported_volumes --volume $var" done } + cmd_help() { echo "" echo "Cloud Hypervisor $(basename "$0")" @@ -625,6 +626,12 @@ cmd_shell() { fix_dir_perms $? } +if [ $# = 0 ]; then + cmd_help + say_err "Please specify command to run!" + exit 1 +fi + # Parse main command line args. # while [ $# -gt 0 ]; do