Loading ...
Sorry, an error occurred while loading the content.

Set options from command line

Expand Messages
  • Alan Green
    I can t figure out how to set the options from the command line when using the WSH Command Line version. Thanks Alan
    Message 1 of 3 , Jun 4, 2008
    • 0 Attachment
      I can't figure out how to set the options from the command line when
      using the WSH Command Line version.
      Thanks
      Alan
    • Douglas Crockford
      If you look at wsh.js, you ll see if (!JSLINT(WScript.StdIn.ReadAll(), {passfail: true})) { The second argument to JSLINT is the options object.
      Message 2 of 3 , Jun 5, 2008
      • 0 Attachment
        If you look at wsh.js, you'll see

        if (!JSLINT(WScript.StdIn.ReadAll(), {passfail: true})) {

        The second argument to JSLINT is the options object.


        Alan Green wrote:
        > I can't figure out how to set the options from the command line when
        > using the WSH Command Line version.
        > Thanks
        > Alan
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
      • wleingang
        Use this wsh wrapper to pass in arguments from the command line. The argument needs to be a single json object with no spaces. See the example below the code:
        Message 3 of 3 , Jun 9, 2008
        • 0 Attachment
          Use this wsh wrapper to pass in arguments from the command line. The
          argument needs to be a single json object with no spaces. See the
          example below the code:

          ================
          ================

          (function () {
          var arguments = WScript.Arguments.length > 0 ? eval('arguments = '
          + WScript.Arguments(0)) : {passfail:false};
          if (!JSLINT(WScript.StdIn.ReadAll(), arguments)) {
          var e = JSLINT.errors;
          for(var i=0;i<e.length-1;i++){
          WScript.StdErr.WriteLine('Lint at line ' + (e[i].line + 1)
          + ' character ' + (e[i].character + 1) + ': ' + e[i].reason);
          WScript.StdErr.WriteLine((e[i].evidence ||
          '').replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
          }
          WScript.Quit(1);
          }
          })();

          ================
          ================

          cscript jslint.js {browser:true,evil:true,passfail:false,undef:false}
          <common.js

          ================
          ================

          --- In jslint_com@yahoogroups.com, "Alan Green" <alan.green.mail@...>
          wrote:
          >
          > I can't figure out how to set the options from the command line when
          > using the WSH Command Line version.
          > Thanks
          > Alan
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.