Search code examples
windowsterminalphantomjscasperjs

Casper CLI Options not handling white spaces on Windows


On Terminal of Mac, if I enter in the command

casperjs test.js --name="Bashir Osman"

it will return

{
    "casper-path": "/Users/casperjs",
    "cli": true,
    "name": "Bashir Osman"
}

However, on Windows (using the same command)

casperjs test.js --name="Bashir Osman"

it will return

{
    "casper-path": "C:\\Users\\casperjs",
    "cli": true,
    "name": "Bashir"
}

found an issue on github, but it seems unrelated


Solution

  • On windows, you'll need multiple double quotes.

    change

    casperjs test.js --name="Bashir Osman"
    

    to

    casperjs test.js --name="""Bashir Osman"""