File pacemaker-tools-improve-crm_standby-option-handling.patch of Package pacemaker

commit 0707b55636a5be99b969604c930baa7d93f91290
Author: Ken Gaillot <kgaillot@redhat.com>
Date:   Wed Jan 3 15:05:48 2018 -0600

    Refactor: tools: improve crm_standby option handling
    
    Follow crm_failcount/crm_master style for consistency

diff --git a/tools/crm_standby b/tools/crm_standby
index 25bff79ce..59e16f823 100755
--- a/tools/crm_standby
+++ b/tools/crm_standby
@@ -40,27 +40,22 @@ options=""
 lifetime=0
 target=""
 
-BACKWARD_COMPATIBLE="get-value,attr-value:,delete-attr,uname:,attr-id:"
-TEMP=$(getopt -o qDGQVN:U:v:i:l: \
-    --long help,version,query,update:,delete,verbose,quiet,node:,lifetime:,id:,$BACKWARD_COMPATIBLE \
-    -n 'crm_standby' -- "$@")
-
+SHORTOPTS_DEPRECATED="U:Q"
+LONGOPTS_DEPRECATED="uname:,get-value,delete-attr,attr-value:,attr-id:"
+SHORTOPTS="VqGv:DN:l:i:"
+LONGOPTS="help,version,verbose,quiet,query,update:,delete,node:,lifetime:,id:"
+
+TEMP=$(getopt -o ${SHORTOPTS}${SHORTOPTS_DEPRECATED} \
+    --long ${LONGOPTS},${LONGOPTS_DEPRECATED} \
+    -n crm_standby -- "$@")
 if [ $? -ne 0 ]; then
     exit_usage
 fi
 
-# The quotes around $TEMP are essential!
-eval set -- "$TEMP"
+eval set -- "$TEMP" # Quotes around $TEMP are essential
 
 while true ; do
     case "$1" in
-        -N|--node|-U|--uname)       target="$2"; shift 2;;
-        -G|--query|--get-value)     options="$options --query"; op=g; shift;;
-        -v|--update|--attr-value)   options="$options --update $2"; op=u; shift 2;;
-        -D|--delete|--delete-attr)  options="$options --delete"; op=d; shift;;
-        -l|--lifetime)              options="$options --lifetime $2"; lifetime=1; shift 2;;
-        -i|--id|--attr-id)          options="$options --id $2"; shift 2;;
-        -q|-Q|--quiet|-V|--verbose) options="$options $1"; shift;;
         --help)
             echo "$HELP_TEXT"
             exit 0
@@ -69,6 +64,42 @@ while true ; do
             crm_attribute --version
             exit 0
             ;;
+        -q|--quiet|-V|--verbose|-Q)
+            options="$options $1"
+            shift
+            ;;
+        -N|--node|-U|--uname)
+            target="$2"
+            shift
+            shift
+            ;;
+        -G|--query|--get-value)
+            options="$options --query"
+            op=g
+            shift
+            ;;
+        -v|--update|--attr-value)
+            options="$options --update $2"
+            op=u
+            shift
+            shift
+            ;;
+        -D|--delete|--delete-attr)
+            options="$options --delete"
+            op=d
+            shift
+            ;;
+        -l|--lifetime)
+            options="$options --lifetime $2"
+            lifetime=1
+            shift
+            shift
+            ;;
+        -i|--id|--attr-id)
+            options="$options --id $2"
+            shift
+            shift
+            ;;
         --)
             shift
             break