mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
On second thought, just saying 'run cake' on error rather than listing all options
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
(function() {
|
||||
var CoffeeScript, cakefileDirectory, fs, helpers, missingOption, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
|
||||
var CoffeeScript, badArgument, cakefileDirectory, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
try {
|
||||
options = oparse.parse(args);
|
||||
} catch (e) {
|
||||
return missingOption(("" + e).match(/option: (.+)/)[1]);
|
||||
return badArgument(("" + e).match(/option: (.+)/)[1], "option");
|
||||
}
|
||||
_ref = options.arguments;
|
||||
_results = [];
|
||||
@@ -78,16 +78,14 @@
|
||||
if (switches.length) return console.log(oparse.help());
|
||||
};
|
||||
|
||||
missingOption = function(option) {
|
||||
console.error("No such option: \"" + option + "\"\n");
|
||||
printTasks();
|
||||
badArgument = function(arg, type) {
|
||||
console.error("No such " + type + ": \"" + arg + "\"\n");
|
||||
console.log('To see a list of all tasks/options, run "cake"');
|
||||
return process.exit(1);
|
||||
};
|
||||
|
||||
missingTask = function(task) {
|
||||
console.error("No such task: \"" + task + "\"\n");
|
||||
printTasks();
|
||||
return process.exit(1);
|
||||
return badArgument(task, "task");
|
||||
};
|
||||
|
||||
cakefileDirectory = function(dir) {
|
||||
|
||||
Reference in New Issue
Block a user