Browse Source

make suggest option disabled by default

pull/10/head
Brett Langdon 10 years ago
parent
commit
bd63cd6d08
2 changed files with 4 additions and 2 deletions
  1. +3
    -1
      bin/jsnice
  2. +1
    -1
      lib/index.js

+ 3
- 1
bin/jsnice View File

@ -8,7 +8,7 @@ var jsnice = require('../');
var doc = [
'Usage:',
' jsnice <file>',
' jsnice [--no-pretty] [--no-rename] [--no-types] <file>',
' jsnice [--no-pretty] [--no-rename] [--no-types] [--suggest] <file>',
' jsnice (--help | --version)',
'',
'Options:',
@ -17,6 +17,7 @@ var doc = [
' --no-pretty Dont prettify the script',
' --no-rename Dont rename variables',
' --no-types Dont add doc strings for params/returns',
' --suggest Suggest new local names e.g. local$$2',
].join('\r\n');
var args = docopt.docopt(doc, {
@ -31,6 +32,7 @@ var options = {
pretty: !args['--no-pretty'],
types: !args['--no-types'],
rename: !args['--no-rename'],
suggest: args['--suggest'],
};
jsnice.nicify(js, options, function(err, data) {
if (err) {


+ 1
- 1
lib/index.js View File

@ -12,7 +12,7 @@ module.exports.nicify = function(js, options, callback) {
pretty: (options.pretty === undefined)? 1 : (options.pretty)? 1 : 0,
rename: (options.rename === undefined)? 1 : (options.rename)? 1 : 0,
types: (options.types === undefined)? 1 : (options.types)? 1 : 0,
suggest: (options.suggest === undefined)? 1 : (options.suggest)? 1 : 0,
suggest: (options.suggest === undefined)? 0 : (options.suggest)? 1 : 0,
};
var reqOptions = {


Loading…
Cancel
Save