Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
5778d580
Commit
5778d580
authored
Jul 05, 2011
by
Leo Gordon
Browse files
fixed a bug that prevented parsing of lists; also allow destringification of values from cmdline
parent
a76403b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
modules/Bio/EnsEMBL/Hive/Utils.pm
modules/Bio/EnsEMBL/Hive/Utils.pm
+6
-6
No files found.
modules/Bio/EnsEMBL/Hive/Utils.pm
View file @
5778d580
...
...
@@ -86,7 +86,7 @@ sub destringify {
if
(
$value
=~
/^'.*'$/
or
$value
=~
/^".*"$/
or
$value
=~
/^{.*}$/
or
$value
=~
/^[.*]$/
)
{
or
$value
=~
/^
\
[.*
\
]$/
)
{
$value
=
eval
(
$value
);
}
...
...
@@ -133,12 +133,12 @@ sub parse_cmdline_options {
my
$temp_key
;
foreach
my
$arg
(
@ARGV
)
{
if
(
$temp_key
)
{
$pairs
{
$temp_key
}
=
$arg
;
if
(
$temp_key
)
{
# only the value, get the key from buffer
$pairs
{
$temp_key
}
=
destringify
(
$arg
)
;
$temp_key
=
'';
}
elsif
(
$arg
=~
/^--?(\w+)=(.+)$/
)
{
$pairs
{
$
1
}
=
$
2
;
}
elsif
(
$arg
=~
/^--?(\w+)$/
)
{
}
elsif
(
$arg
=~
/^--?(\w+)=(.+)$/
)
{
# both the key and the value
$pairs
{
$
1
}
=
destringify
(
$
2
)
;
}
elsif
(
$arg
=~
/^--?(\w+)$/
)
{
# only the key, buffer it and expect the value on the next round
$temp_key
=
$
1
;
}
else
{
push
@list
,
$arg
;
...
...
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