From 220d299d1046eca7e1c42b53cecc5b39fcaf1ddc Mon Sep 17 00:00:00 2001
From: Markus Opolka <markus.opolka@netways.de>
Date: Tue, 8 Nov 2022 15:30:37 +0100
Subject: [PATCH] Add proper usage of usage()

---
 icinga-build-docker | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/icinga-build-docker b/icinga-build-docker
index 338482d..cc5ee98 100755
--- a/icinga-build-docker
+++ b/icinga-build-docker
@@ -1,5 +1,6 @@
 #!/bin/bash
 
+
 set -e
 
 ## config
@@ -14,13 +15,24 @@ SCRIPT_HOME="$(dirname "$(readlink -f "$0")")"
 usage() {
   echo "$0 <target>"
   echo
+  echo "This starts a Container speficied as first arguments. Example:"
+  echo "icinga-build-docker centos/7:x86_64"
+  echo
+  echo "The Container will then run icinga-build-package as CMD"
+  echo "Important: This script needs to run in the directory that contains the build"
 }
 
+if [[ "$1" = "--help" ]]; then
+    usage
+    exit 0
+fi
+
 if [ -n "$1" ]; then
   TARGET="$1"
   shift
 else
   echo "Target is missing!" >&2
+  usage
   exit 1
 fi
 
-- 
GitLab