OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * Shared functionality used by command line and dartium dwc frontends. |
| 7 * Once dart:io dependencies are all abstracted out into |
| 8 * src/tempalte/file_system this file can go away and dwc.dart can be used |
| 9 * by both command line and dartium frontends. |
| 10 */ |
| 11 library dwc_shared; |
| 12 |
| 13 import 'package:args/args.dart'; |
| 14 import 'src/template/cmd_options.dart'; |
| 15 import 'src/template/file_system.dart'; |
| 16 import 'src/template/file_system_memory.dart'; |
| 17 import 'src/template/world.dart'; |
| 18 |
| 19 ArgParser commandOptions() { |
| 20 return new ArgParser() |
| 21 ..addFlag('verbose', help: 'Display detail info', defaultsTo: false) |
| 22 ..addFlag('clean', help: 'Remove all generated files', defaultsTo: false) |
| 23 ..addFlag('dump', help: 'Dump AST', defaultsTo: false) |
| 24 ..addFlag('suppress_warnings', help: 'Warnings not displayed', |
| 25 defaultsTo: true) |
| 26 ..addFlag('warnings_as_errors', help: 'Warning handled as errors', |
| 27 defaultsTo: false) |
| 28 ..addFlag('throw_on_errors', help: 'Throw on errors encountered', |
| 29 defaultsTo: false) |
| 30 ..addFlag('throw_on_warnings', help: 'Throw on warnings encountered', |
| 31 defaultsTo: false) |
| 32 ..addFlag('no_colors', help: 'Display errors/warnings in colored text', |
| 33 defaultsTo: true) |
| 34 ..addFlag('help', help: 'Displays this help message', defaultsTo: false); |
| 35 } |
| 36 |
| 37 void initHtmlWorld(CmdOptions opts) { |
| 38 var fs = new MemoryFileSystem(); |
| 39 initializeWorld(fs, opts); |
| 40 |
| 41 // TODO(terry): Should be set by arguments. When run as a tool these aren't |
| 42 // set when run internaly set these so we can compile CSS and catch any |
| 43 // problems programmatically. |
| 44 // options.throwOnErrors = true; |
| 45 // options.throwOnFatal = true; |
| 46 // options.useColors = commandLine ? true : false; |
| 47 } |
OLD | NEW |