Commit 97550163 9755016311a77529e2a2ec945b86e1d7fa53c64b by Nicolas Perriault

added cliplay.(js|coffee) to play around with cli arguments handling

1 parent 14c1f1b9
1 Subproject commit e46d6689f5cee8d66cd6f2952f8f41d8635f0ea0 1 Subproject commit d0f987e0cf96a019e27201001ba158dbd7a899be
......
1 casper = require("casper").create()
2 dump = require("utils").dump
3
4 # removing default options passed by the Python executable
5 casper.cli.drop "cli"
6 casper.cli.drop "casper-path"
7
8 if casper.cli.args.length is 0 and Object.keys(casper.cli.options).length is 0
9 casper.echo("Pass some args and options to see how they are handled by CasperJS").exit()
10
11 casper.echo "Casper CLI passed args:"
12 dump casper.cli.args
13
14 casper.echo "Casper CLI passed options:"
15 dump casper.cli.options
16
17 casper.exit()
1 var casper = require("casper").create();
2 var dump = require("utils").dump;
3
4 // removing default options passed by the Python executable
5 casper.cli.drop("cli");
6 casper.cli.drop("casper-path");
7
8 if (casper.cli.args.length === 0 && Object.keys(casper.cli.options).length === 0) {
9 casper.echo("Pass some args and options to see how they are handled by CasperJS").exit();
10 }
11
12 casper.echo("Casper CLI passed args:");
13 dump(casper.cli.args);
14
15 casper.echo("Casper CLI passed options:");
16 dump(casper.cli.options);
17
18 casper.exit();
...\ No newline at end of file ...\ No newline at end of file