brenolf / polyjuice

A utility to convert JSHint and JSCS files into ESLint files and vice-versa
MIT License
275 stars 15 forks source link

Node error when running commands from --help #9

Closed pdehaan closed 9 years ago

pdehaan commented 9 years ago

I happened to be looking at --help and noticed a lack of = between the flag and the filename. Feeling bold, I tested it. It didn't end well.

$ polyjuice --help

Usage: polyjuice [options]

    --help, -h
        Displays help information about this script
        'polyjuice -h' or 'polyjuice --help'

    --jshint
        Defines the source file for jshint
        'polyjuice --jshint .jshintrc'

    --jscs
        Defines the source file for jscs
        'polyjuice --jscs .jscsrc'

And here is the output:

$ polyjuice --jscs .jscsrc

fs.js:439
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'true'
    at Object.fs.openSync (fs.js:439:18)
    at Object.fs.readFileSync (fs.js:290:15)
    at Object.module.exports [as jscs] (/Users/pdehaan/.npm-packages/lib/node_modules/polyjuice/lib/polyjuice/jscs.js:17:28)
    at Object.<anonymous> (/Users/pdehaan/.npm-packages/lib/node_modules/polyjuice/lib/bin.js:30:27)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)

Long story longer, I think the --help docs need to be updated to include an = between the --jscs=.jscsrc (and same w/ JSHint example).