From 0dc4941f6123cc2143125405aff53048ecaa9c30 Mon Sep 17 00:00:00 2001 From: Artur Zarzycki Date: Wed, 25 Jan 2017 13:26:46 +0100 Subject: [PATCH] Change option to -o | --output-dir and fix problem with pointing this dir Changing option to more intuitive -o like output-dir and also there was missing shift so option to point output dir didn't work correctly Change-Id: I2233a295301b903e465bafa6720d1d4e28d60b18 --- tools/diagnostic-snapshot.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/diagnostic-snapshot.sh b/tools/diagnostic-snapshot.sh index ffde22a0..8b59a15f 100755 --- a/tools/diagnostic-snapshot.sh +++ b/tools/diagnostic-snapshot.sh @@ -33,7 +33,7 @@ function usage { Usage: $0 [-o LOG_DIR] [-n NAMESPACE] -h|--help Print this help - -l|--log-dir Logs output directory (optional - default /tmp/ccp-diag) + -o|--output-dir Logs output directory (optional - default /tmp/ccp-diag) -n|--namespace Kubernetes namespace (optional - default ccp) EOF exit @@ -94,7 +94,7 @@ function ccp_data { # Parse command line arguments: -OPTS=`getopt -o 'hl:n:' --long help,log-dir:,namespace: -n 'parse-options' -- ${@}` +OPTS=`getopt -o 'ho:n:' --long help,output-dir:,namespace: -n 'parse-options' -- ${@}` if [ ${?} != 0 ] ; then echo "Failed parsing options." exit 1 @@ -104,8 +104,8 @@ eval set -- ${OPTS} while [ -n "${1}" ]; do case ${1} in -h|--help ) usage; shift ;; - -l|--log-dir ) LOG_DIR=${2}; shift; shift ;; - -n|--namespace ) NAMESPACE=${2}; shift ;; + -o|--output-dir ) LOG_DIR=${2}; shift; shift ;; + -n|--namespace ) NAMESPACE=${2}; shift; shift ;; -- ) shift; break ;; * ) break ;; esac