// Copyright (c) Microsoft Open Technologies, Inc.  All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

(function() {
    "use strict";
    var config = require("../../config.js");
    var parseArgs = require("minimist");

    module.exports = {
        runTests: {
            command: function () {
                // Default args
                var files = ["*.js"];
                var host = "wwa";
                var debug = false;

                // Get arguments
                var args = parseArgs(process.argv);
                args.files = args.files || args.file;
                args.host = args.host || args.h;
                args.debug = args.debug || args.d;
                files = args.files.split(",");
                host = args.host.toLowerCase();
                debug = args.debug;

                // Build up command string
                var command = "%_NTTREE%/Corsica/other.2.1.debug/Tools/WebUnit/WebUnit.exe";
            for (var i = 0, l = files.length; i < l; ++i)
                    command +=  " /s:%_NTTREE%/Corsica/other." + config.version + ".debug/Tests/UnitTests/" + files[i];
                if (debug)
                    command += " /debug";
                if (host === "vs")
                    command += " /vs";
                else
                    command += " /host:" + host;
                command += " @res.txt";
                return command;
            },
            options: {
                stdout: true,
                stderr: true
            }
        },
        openQUnitTestPage: {
            command: "start bin/tests/tests.html"
        }
};
})();
@@ -752,16 +752,52 @@
 args.d;%0A
+                if (args.files)%0A    
         
@@ -855,40 +855,111 @@
     
-host = args.host.toLowerCase();%0A
+if (args.host)%0A                    host = args.host.toLowerCase();%0A                if (args.debug)%0A    
     
@@ -1580,16 +1580,26 @@
   return
+ %22echo %22 +
  command

Fix args parsing to work with default params