diff mbox

[RFC,2/4] genimage.sh: fix getopts traces

Message ID 20170418155554.28732-3-etienne.phelip@savoirfairelinux.com
State Rejected
Headers show

Commit Message

Phelip Etienne April 18, 2017, 3:55 p.m. UTC
The first trace is never displayed, the second shows an empty string
because OPTARG is not set.

To display both traces properly, the optstring of getopts needs to
start with a colon.

Signed-off-by: Etienne Phelip <etienne.phelip@savoirfairelinux.com>
---
 support/scripts/genimage.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/support/scripts/genimage.sh b/support/scripts/genimage.sh
index 6684e73..6f9102c 100755
--- a/support/scripts/genimage.sh
+++ b/support/scripts/genimage.sh
@@ -10,7 +10,7 @@  GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
 # First argument is BINARIES_DIR, skip it
 shift
 
-while getopts c: OPT ; do
+while getopts :c: OPT ; do
 	case "${OPT}" in
 	c) GENIMAGE_CFG="${OPTARG}";;
 	:) die "option '${OPTARG}' expects a mandatory argument\n";;