Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Merge requests
!129
Db Profiles
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Db Profiles
db-detector
into
master
Overview
0
Commits
63
Pipelines
0
Changes
1
Merged
Db Profiles
Hahn Axel (hahn)
requested to merge
db-detector
into
master
Feb 20, 2024
Overview
0
Commits
63
Pipelines
0
Changes
1
0
0
Merge request reports
Viewing commit
67b5000f
Prev
Next
Show latest version
1 file
+
28
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
67b5000f
handle empty selection in showSelectAndInput
· 67b5000f
Hahn Axel (hahn)
authored
Mar 15, 2024
localdump.sh
+
28
−
21
View file @ 67b5000f
Edit in single-file editor
Open in Web IDE
Show full file
@@ -256,26 +256,33 @@
# param string selection of items to select from
# param string prompt to show
function
showSelectAndInput
(){
local
_selection
=
"
$1
"
local
_prompt
=
"
$2
"
local
_lines
typeset
-i
_lines
;
_lines
=
$(
grep
-c
"."
<<<
"
$_selection
"
)
if
[
$_lines
-eq
"1"
]
;
then
echo
"INFO: No interaction on a single choice. Using '
$_selection
'"
LASTINPUT
=
"
$_selection
"
return
0
else
echo
"
$_selection
"
color.print input
"
${
_prompt
}
>"
read
-r
LASTINPUT
if
[
-z
"
$LASTINPUT
"
]
;
then
echo
"No input given. Aborting."
exit
1
fi
fi
local
_selection
=
"
$1
"
local
_prompt
=
"
$2
"
local
_lines
typeset
-i
_lines
;
_lines
=
$(
grep
-c
"."
<<<
"
$_selection
"
)
case
$_lines
in
0
)
color.echo error
"ERROR no data for a further selection. Aborting."
echo
exit
1
;;
1
)
echo
"INFO: No interaction on a single choice. Using '
$_selection
'"
LASTINPUT
=
"
$_selection
"
return
0
;;
*
)
echo
"
$_selection
"
color.print input
"
${
_prompt
}
>"
read
-r
LASTINPUT
if
[
-z
"
$LASTINPUT
"
]
;
then
echo
"No input given. Aborting."
exit
1
fi
;;
esac
}
# ------------------------------------------------------------
@@ -358,7 +365,7 @@ EOH
while
[[
"$#"
-gt
0
]]
;
do case
$1
in
-h
|
--help
)
showhelp
;
exit
0
;;
*
)
if
grep
"^-"
<<<
"
$1
"
>
/dev/null
;
then
echo
;
echo
"ERROR: Unknown parameter:
$1
"
;
echo
;
showhelp
;
exit
2
echo
;
color.echo error
"ERROR: Unknown parameter:
$1
"
;
echo
;
showhelp
;
exit
2
fi
break
;
;;
Loading