Compare commits
1 Commits
256a93ed38
...
f2143633c5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2143633c5 |
@@ -45,6 +45,10 @@ OPTIONS
|
|||||||
--debug, -d
|
--debug, -d
|
||||||
Display debugging output
|
Display debugging output
|
||||||
|
|
||||||
|
--array, -a ARRAY
|
||||||
|
Read arguments from an existing or new ARRAY (bash >= 4.3)
|
||||||
|
This is useful to reduce parsing errors and recommended for build-wrapper plugins
|
||||||
|
|
||||||
--silent, -s
|
--silent, -s
|
||||||
Don't output anything from this program (container output will still be passed to stdout
|
Don't output anything from this program (container output will still be passed to stdout
|
||||||
if -it option is used instead of -d, see `man podman run` for more information)
|
if -it option is used instead of -d, see `man podman run` for more information)
|
||||||
@@ -70,10 +74,10 @@ EOF
|
|||||||
_runDebug "${FUNCNAME[0]}" "$@"
|
_runDebug "${FUNCNAME[0]}" "$@"
|
||||||
|
|
||||||
# Unset vars
|
# Unset vars
|
||||||
unset _cname _image _release _ephemeral _recreate _no_sh _debug _silent
|
unset _array
|
||||||
|
|
||||||
# Parse input and set switches using getopt
|
# Parse input and set switches using getopt
|
||||||
if _input=$(getopt -o +c:i:r:ndsh -l container:,image:,release:,ephemeral,recreate,no-sh,debug,silent,help -- "$@"); then
|
if _input=$(getopt -o +c:i:r:a:ndsh -l container:,image:,release:,ephemeral,recreate,no-sh,debug,array:,silent,help -- "$@"); then
|
||||||
eval set -- "$_input"
|
eval set -- "$_input"
|
||||||
while true; do
|
while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -99,6 +103,10 @@ EOF
|
|||||||
_debug="true"
|
_debug="true"
|
||||||
echo "Debugging on!"
|
echo "Debugging on!"
|
||||||
;;
|
;;
|
||||||
|
--array|-a)
|
||||||
|
shift && _array="$1"
|
||||||
|
break
|
||||||
|
;;
|
||||||
--silent)
|
--silent)
|
||||||
#_silent="true"
|
#_silent="true"
|
||||||
;;
|
;;
|
||||||
@@ -117,6 +125,15 @@ EOF
|
|||||||
_printHelpAndExit 1
|
_printHelpAndExit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If array mode, load input array, reparse input, and return
|
||||||
|
if [[ -n $_array ]]; then
|
||||||
|
checkBashVersion
|
||||||
|
local _n_array
|
||||||
|
declare -n _n_array="$_array"
|
||||||
|
_parseInput "${_n_array[@]}"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# Create _pre_commands_array from remaining arguments
|
# Create _pre_commands_array from remaining arguments
|
||||||
# shift getopt parameters away
|
# shift getopt parameters away
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|||||||
Reference in New Issue
Block a user