mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-17 11:01:25 -05:00
fixing long-flag-with-optional-part in optparse.coffee, and hiding bin/node_coffee --watch until we implement it
This commit is contained in:
@@ -5,7 +5,10 @@
|
|||||||
coffee = require('coffee-script');
|
coffee = require('coffee-script');
|
||||||
optparse = require('optparse');
|
optparse = require('optparse');
|
||||||
BANNER = "coffee compiles CoffeeScript source files into JavaScript.\n\nUsage:\n coffee path/to/script.coffee";
|
BANNER = "coffee compiles CoffeeScript source files into JavaScript.\n\nUsage:\n coffee path/to/script.coffee";
|
||||||
SWITCHES = [['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-r', '--run', 'compile and run a CoffeeScript'], ['-o', '--output [DIR]', 'set the directory for compiled JavaScript'], ['-w', '--watch', 'watch scripts for changes, and recompile'], ['-p', '--print', 'print the compiled JavaScript to stdout'], ['-l', '--lint', 'pipe the compiled JavaScript through JSLint'], ['-e', '--eval', 'compile a string from the command line'], ['-t', '--tokens', 'print the tokens that the lexer produces'], ['-tr', '--tree', 'print the parse tree that Jison produces'], ['-v', '--version', 'display CoffeeScript version'], ['-h', '--help', 'display this help message']];
|
SWITCHES = [['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-r', '--run', 'compile and run a CoffeeScript'], ['-o', '--output [DIR]', 'set the directory for compiled JavaScript'],
|
||||||
|
// ['-w', '--watch', 'watch scripts for changes, and recompile']
|
||||||
|
['-p', '--print', 'print the compiled JavaScript to stdout'], ['-l', '--lint', 'pipe the compiled JavaScript through JSLint'], ['-e', '--eval', 'compile a string from the command line'], ['-t', '--tokens', 'print the tokens that the lexer produces'], ['-tr', '--tree', 'print the parse tree that Jison produces'], ['-v', '--version', 'display CoffeeScript version'], ['-h', '--help', 'display this help message']
|
||||||
|
];
|
||||||
WATCH_INTERVAL = 0.5;
|
WATCH_INTERVAL = 0.5;
|
||||||
options = {};
|
options = {};
|
||||||
sources = [];
|
sources = [];
|
||||||
|
|||||||
@@ -89,8 +89,9 @@
|
|||||||
build_rule = function build_rule(letter, flag, description) {
|
build_rule = function build_rule(letter, flag, description) {
|
||||||
var match;
|
var match;
|
||||||
match = flag.match(OPTIONAL);
|
match = flag.match(OPTIONAL);
|
||||||
|
flag = flag.match(LONG_FLAG)[1];
|
||||||
return {
|
return {
|
||||||
name: flag.match(LONG_FLAG)[1].substr(2),
|
name: flag.substr(2),
|
||||||
letter: letter,
|
letter: letter,
|
||||||
flag: flag,
|
flag: flag,
|
||||||
description: description,
|
description: description,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ SWITCHES: [
|
|||||||
['-i', '--interactive', 'run an interactive CoffeeScript REPL']
|
['-i', '--interactive', 'run an interactive CoffeeScript REPL']
|
||||||
['-r', '--run', 'compile and run a CoffeeScript']
|
['-r', '--run', 'compile and run a CoffeeScript']
|
||||||
['-o', '--output [DIR]', 'set the directory for compiled JavaScript']
|
['-o', '--output [DIR]', 'set the directory for compiled JavaScript']
|
||||||
['-w', '--watch', 'watch scripts for changes, and recompile']
|
# ['-w', '--watch', 'watch scripts for changes, and recompile']
|
||||||
['-p', '--print', 'print the compiled JavaScript to stdout']
|
['-p', '--print', 'print the compiled JavaScript to stdout']
|
||||||
['-l', '--lint', 'pipe the compiled JavaScript through JSLint']
|
['-l', '--lint', 'pipe the compiled JavaScript through JSLint']
|
||||||
['-e', '--eval', 'compile a string from the command line']
|
['-e', '--eval', 'compile a string from the command line']
|
||||||
|
|||||||
@@ -59,8 +59,9 @@ build_rules: (rules) ->
|
|||||||
# Build a rule from a short-letter-flag, long-form-flag, and help text.
|
# Build a rule from a short-letter-flag, long-form-flag, and help text.
|
||||||
build_rule: (letter, flag, description) ->
|
build_rule: (letter, flag, description) ->
|
||||||
match: flag.match(OPTIONAL)
|
match: flag.match(OPTIONAL)
|
||||||
|
flag: flag.match(LONG_FLAG)[1]
|
||||||
{
|
{
|
||||||
name: flag.match(LONG_FLAG)[1].substr(2)
|
name: flag.substr(2)
|
||||||
letter: letter
|
letter: letter
|
||||||
flag: flag
|
flag: flag
|
||||||
description: description
|
description: description
|
||||||
|
|||||||
Reference in New Issue
Block a user