Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a verbose command line option. #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var nopt = require('nopt'),
'silent': Boolean,
'strict': Boolean,
'version': Boolean,
'verbose': Boolean,
'walk': Boolean,
'watch': Boolean,
'yui-module': require('path')
Expand Down Expand Up @@ -90,6 +91,8 @@ var setDefaults = function(parsed) {
parsed['lint-stderr'] = (parsed['lint-stderr'] === undefined || parsed['lint-stderr'] === false) ? false : true;
parsed.progress = (parsed.progress === undefined || parsed.progress === false) ? false : true;
parsed.recursive = (parsed.recursive === undefined || parsed.recursive === false) ? false : true;
parsed.verbose = (parsed.verbose === undefined || parsed.verbose === false) ? false : true;


if (parsed.recursive) {
parsed.walk = true;
Expand Down
3 changes: 3 additions & 0 deletions lib/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ if (args.help) {
console.log(' all other build options accepted here: (--strict, --lint, etc)');
console.log(' --jsstamp/--no-jsstamp Should it stamp the JS with the YUI.add wrapper, defaults to --stamp');
console.log(' --istanbul Use Istanbul code coverage instead of YUITest for coverage build');
console.log(' --quiet Show only the number of issues for each file');
console.log(' --silent Do not show anything');
console.log(' --verbose Show detailed info about what it is doing');
console.log('Experimental Options:');
console.log(' --semi Toggle on the strict semicolon checking in Uglify');
console.log(' --cache/--no-cache Cache the results of the build and bail if building for no reason, defaults to --no-cache');
Expand Down
4 changes: 4 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ exports.init = function (opts, initCallback) {
log.silent();
}

if (options.verbose) {
log.verbose();
}

log.info('revving up');
if (!options.walk) {
log.info('looking for ' + buildFileName + ' file');
Expand Down
9 changes: 7 additions & 2 deletions lib/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var hasColor = process.stdin.isTTY;

var quiet;
var silent;
var verbose;

var prefix;

Expand All @@ -22,6 +23,10 @@ exports.silent = function () {
quiet = true;
};

exports.verbose = function () {
verbose = true;
};

exports.reset = function(options) {
silent = false;
quiet = false;
Expand All @@ -40,13 +45,13 @@ exports.color = function (str, code) {


exports.info = function (str) {
if (!quiet) {
if (verbose) {
console.log(prefix, exports.color('[info]', 'white'), str);
}
};

exports.log = function (str) {
if (!quiet) {
if (verbose) {
console.log(prefix, exports.color('[queu]', 'cyan'), str);
}
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "shifter",
"description": "New YUI build tool based on Gearjs, so let's shift some gears",
"author": "Dav Glass <[email protected]>",
"version": "0.4.1",
"version": "0.4.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great pull, except for this change. Generally speaking, the version number should never be touched in a pull request. It'll be modified by the maintainer when they decide to publish a release.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't realize that. I changed it so I could install it myself and try it out, then, not knowing any better, I just left it behind.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, just pointing it out. :)

Locally, npm link in the root of the package should be sufficient to test, no need to modify the version string.

On Jun 26, 2013, at 12:12 PM, Satyam wrote:

In package.json:

@@ -2,7 +2,7 @@
"name": "shifter",
"description": "New YUI build tool based on Gearjs, so let's shift some gears",
"author": "Dav Glass [email protected]",

  • "version": "0.4.1",
  • "version": "0.4.2",
    Sorry, I didn't realize that. I changed it so I could install it myself and try it out, then, not knowing any better, I just left it behind.


Reply to this email directly or view it on GitHub.

"dependencies": {
"progress": "~0.1.0",
"ansi-color": "*",
Expand Down