diff --git a/opener.js b/opener.js index b493fa6..5cdfd72 100644 --- a/opener.js +++ b/opener.js @@ -14,6 +14,20 @@ function opener(args, options, callback) { args = [args]; } + if (typeof options === "function") { + callback = options; + options = {}; + } + + if (options && typeof options === "object" && options.command) { + if (process.platform === "win32") { + // *always* use cmd on windows + args = [options.command].concat(args); + } else { + cmd = options.command; + } + } + if (process.platform === "win32") { // On Windows, we really want to use the "start" command. But, the rules regarding arguments with spaces, and // escaping them with quotes, can get really arcane. So the easiest way to deal with this is to pass off the