Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Laurell, Pontus Bengt Johan
dmrgpp
Commits
c2535ae3
Commit
c2535ae3
authored
Aug 29, 2019
by
Alvarez, Gonzalo
Browse files
OmegaUtils: deal with repeated keys
parent
e3c46c01
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/OmegaUtils.pm
View file @
c2535ae3
...
...
@@ -17,7 +17,23 @@ sub getLabels
chomp
;
foreach
my
$key
(
keys
%$hptr
)
{
if
(
/$key[= ]([^ ]+)/
)
{
$
{
$hptr
->
{
$key
}}
=
$
1
;
my
$newVal
=
$
1
;
my
$prev
=
$
{
$hptr
->
{
$key
}};
if
(
$prev
)
{
print
STDERR
"
Already a previous value for
$key
of
$prev
\n
";
print
"
New value is
$newVal
\n
";
print
"
To take new value press ENTER. Or enter value
";
$_
=
<
STDIN
>
;
chomp
;
if
(
$_
)
{
$
{
$hptr
->
{
$key
}}
=
$_
;
print
STDERR
"
$0: Value for
$key
is
"
.
$
{
$hptr
->
{
$key
}}
.
"
\n
";
next
;
}
}
$
{
$hptr
->
{
$key
}}
=
$newVal
;
print
STDERR
"
$0: Value for
$key
is
"
.
$
{
$hptr
->
{
$key
}}
.
"
\n
";
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment