Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
06fca0a4
...
06fca0a40a13320c495ec75bc267082d828aa4f5
authored
2012-05-09 08:54:50 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixes #109 - args containing = (equals sign) not parsed properly
1 parent
5ad676ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
CHANGELOG.md
modules/cli.js
tests/suites/cli.js
CHANGELOG.md
View file @
06fca0a
...
...
@@ -11,6 +11,8 @@ XXXX-XX-XX, v0.6.7
> which causes the phantomjs subprocess to completely replace the casperjs parent
> process (while maintaining the same pid). This patch also has the added benefit of
> saving 10 megs or so of memory because the python process is discarded.
-
fixes
[
#109
](
https://github.com/n1k0/casperjs/issues/109
)
- CLI args containing
`=`
(equals sign) were not parsed properly
-
fixes
[
#100
](
https://github.com/n1k0/casperjs/issues/100
)
&
[
#110
](
https://github.com/n1k0/casperjs/issues/110
)
-
*googlepagination*
sample was broken
2012-04-27, v0.6.6
------------------
...
...
modules/cli.js
View file @
06fca0a
...
...
@@ -85,7 +85,7 @@ exports.parse = function parse(phantomArgs) {
phantomArgs
.
forEach
(
function
_forEach
(
arg
)
{
if
(
arg
.
indexOf
(
'--'
)
===
0
)
{
// named option
var
optionMatch
=
arg
.
match
(
/^--
(
.*
)
=
(
.*
)
/i
);
var
optionMatch
=
arg
.
match
(
/^--
(
.*
?
)
=
(
.*
)
/i
);
if
(
optionMatch
)
{
extract
.
options
[
optionMatch
[
1
]]
=
castArgument
(
optionMatch
[
2
]);
}
else
{
...
...
tests/suites/cli.js
View file @
06fca0a
...
...
@@ -32,10 +32,10 @@ t.comment('parse(), get(), has()');
(
function
(
parsed
)
{
t
.
assertEquals
(
parsed
.
args
,
[],
'parse() returns expected positional args array'
);
t
.
assertEquals
(
parsed
.
options
,
{
'&é"à'
:
42
},
'parse() returns expected options object'
);
t
.
assertEquals
(
parsed
.
get
(
'&é"à'
),
42
,
'parse() handles options with exotic names'
);
t
.
assertEquals
(
parsed
.
options
,
{
'&é"à'
:
"42===42"
},
'parse() returns expected options object'
);
t
.
assertEquals
(
parsed
.
get
(
'&é"à'
),
"42===42"
,
'parse() handles options with exotic names'
);
t
.
assert
(
parsed
.
has
(
'&é"à'
),
'has() checks if an option is set'
);
})(
cli
.
parse
([
'--&é"à=42'
]));
})(
cli
.
parse
([
'--&é"à=42
===42
'
]));
(
function
(
parsed
)
{
t
.
assertEquals
(
parsed
.
args
,
[
'foo & bar'
,
'baz & boz'
],
'parse() returns expected positional args array'
);
...
...
Please
register
or
sign in
to post a comment