mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
documenting optparse.coffee and repl.coffee
This commit is contained in:
parent
4906cf1aff
commit
d46daa1d7c
12 changed files with 154 additions and 102 deletions
|
|
@ -20,7 +20,7 @@
|
|||
option_parser = null;
|
||||
// Run `coffee` by parsing passed options and determining what action to take.
|
||||
// Many flags cause us to divert before compiling anything. Flags passed after
|
||||
// `--` will be passed verbatim to your script as arguments in `process.ARGV`
|
||||
// `--` will be passed verbatim to your script as arguments in `process.argv`
|
||||
exports.run = function run() {
|
||||
var flags, separator;
|
||||
parse_options();
|
||||
|
|
@ -197,10 +197,10 @@
|
|||
return puts(strings.join(' '));
|
||||
};
|
||||
// Use the [OptionParser module](optparse.html) to extract all options from
|
||||
// `process.ARGV` that are specified in `SWITCHES`.
|
||||
// `process.argv` that are specified in `SWITCHES`.
|
||||
parse_options = function parse_options() {
|
||||
option_parser = new optparse.OptionParser(SWITCHES, BANNER);
|
||||
options = option_parser.parse(process.ARGV);
|
||||
options = option_parser.parse(process.argv);
|
||||
return sources = options.arguments.slice(2, options.arguments.length);
|
||||
};
|
||||
// The compile-time options to pass to the CoffeeScript compiler.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue