Repair broken JCL construction for a few switches
jira-search.sh
--------------
o Declare more array vars for gathering input.
o Replace declare with local within functions.
o Refactored arg detection to set parsting state variables.
o Replace inline AND/OR construction with list join on and/or.
Too many edge cases can leave a AND/OR token prefix or suffix
breaking the JCL query line.
o do_labels logic updated to handle --label-is-empty and construct
--excl and --incl arguments as standalone paren wrapped terms.
jira-search/getopt/detect-modifiers.sh
--------------------------------------
o when -and, -or, -in, -excl, -incl, -is-empty switch modifiers are
detected set global switch parsing state variables.
Signed-off-by: Joey Armstrong <jarmstrong@linuxfoundation.org>
Change-Id: Ib67bbf1a6389c8d9e9a3ac70911429118228c683
diff --git a/jira/jira-search/include.sh b/jira/jira-search/include.sh
new file mode 100644
index 0000000..57405c9
--- /dev/null
+++ b/jira/jira-search/include.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+function init()
+{
+ declare pgm=''
+ pgm="$(realpath --canonicalize-existing "$0")"
+ readonly pgm
+
+ declare -g pgmsrc
+ pgmsrc="$(readlink --canonicalize-existing "${BASH_SOURCE[0]}")"
+ readonly pgmsrc
+
+ # stack-trace-on-error
+ # interrupt handler
+ # mkdir with auto-cleanup at exit
+ declare pgm_root="${pgm%%/jira/jira-search/include.sh}"
+
+ declare root
+ root="${pgm%%/jira/bin/jira-search.sh}"
+ source "$root/lf/onf-common/common.sh" '--common-args-begin--'
+
+ pgm_lib="${root}/jira/jira-search"
+ readonly pgm_lib
+
+ pgm_bin="${root}/bin"
+ readonly pgm_bin
+
+ pgm_help="${root}/jira/jira-search/help"
+ readonly pgm_help
+}
+# init
+# unset init
+
+##--------------------##
+##---] INCLUDES [---##
+##--------------------##
+source "${pgm_lib}/getopt/detect-modifiers.sh"
+
+# source "${pgm_lib}/utils.sh"
+#source "$pgmlib/fixversion.sh"
+#source "$pgmlib/resolved.sh"
+source "${pgm_lib}/fixversion.sh"
+source "${pgm_lib}/resolved.sh"
+source "${pgm_lib}/help/utils.sh"
+
+# [EOF]