From 92540d5e85d89f1a2332f61e7f0e8cbdf225f12b Mon Sep 17 00:00:00 2001
From: Jeremy Ashkenas
Keep track of the list of defined tasks, the accepted options, and so on.
tasks: {}
options: {}
switches: []
-oparse: nullMixin the top-level Cake functions for Cakefiles to use directly.
helpers.extend global, {Define a Cake task with a short name, a sentence description, +oparse: null
Mixin the top-level Cake functions for Cakefiles to use directly.
helpers.extend global, {Define a Cake task with a short name, an optional sentence description, and the function to run as the action itself.
task: (name, description, action) ->
+ [action, description]: [description, action] unless action
tasks[name]: {name: name, description: description, action: action}Define an option that the Cakefile accepts. The parsed options hash, containing all of the command-line options passed, will be made available as the first argument to the action.
option: (letter, flag, description) ->
@@ -35,9 +36,10 @@ If no tasks are passed, print the help screen. Print an error and exit when attempting to all an undefined task.
no_such_task: (task) ->
- process.stdio.writeError "No such task: \"$task\"\n"
+ puts "No such task: \"$task\"\n"
process.exit 1