Index: packages/csslib/lib/src/options.dart |
diff --git a/packages/csslib/lib/src/options.dart b/packages/csslib/lib/src/options.dart |
index c80370b45d16e2179455f0361381f37b7ba91647..56c358b2f06dfedc79bca79682dd5db5bcfd9593 100644 |
--- a/packages/csslib/lib/src/options.dart |
+++ b/packages/csslib/lib/src/options.dart |
@@ -4,8 +4,6 @@ |
library csslib.src.options; |
-import 'package:args/args.dart'; |
- |
class PreprocessorOptions { |
/** Generate polyfill code (e.g., var, etc.) */ |
final bool polyfill; |
@@ -50,68 +48,4 @@ class PreprocessorOptions { |
this.useColors: true, |
this.polyfill: false, |
this.inputFile}); |
- |
- PreprocessorOptions.fromArgs(ArgResults args) |
- : warningsAsErrors = args['warnings_as_errors'], |
- throwOnWarnings = args['throw_on_warnings'], |
- throwOnErrors = args['throw_on_errors'], |
- verbose = args['verbose'], |
- checked = args['checked'], |
- lessSupport = args['less'], |
- useColors = args['colors'], |
- polyfill = args['polyfill'], |
- inputFile = args.rest.length > 0 ? args.rest[0] : null; |
- |
- // tool.dart [options...] <css file> |
- static PreprocessorOptions parse(List<String> arguments) { |
- var parser = new ArgParser() |
- ..addFlag('verbose', |
- abbr: 'v', |
- defaultsTo: false, |
- negatable: false, |
- help: 'Display detail info') |
- ..addFlag('checked', |
- defaultsTo: false, |
- negatable: false, |
- help: 'Validate CSS values invalid value display a warning message') |
- ..addFlag('less', |
- defaultsTo: true, |
- negatable: true, |
- help: 'Supports subset of Less syntax') |
- ..addFlag('suppress_warnings', |
- defaultsTo: true, help: 'Warnings not displayed') |
- ..addFlag('warnings_as_errors', |
- defaultsTo: false, help: 'Warning handled as errors') |
- ..addFlag('throw_on_errors', |
- defaultsTo: false, help: 'Throw on errors encountered') |
- ..addFlag('throw_on_warnings', |
- defaultsTo: false, help: 'Throw on warnings encountered') |
- ..addFlag('colors', |
- defaultsTo: true, help: 'Display errors/warnings in colored text') |
- ..addFlag('polyfill', |
- defaultsTo: false, help: 'Generate polyfill for new CSS features') |
- ..addFlag('help', |
- abbr: 'h', |
- defaultsTo: false, |
- negatable: false, |
- help: 'Displays this help message'); |
- |
- try { |
- var results = parser.parse(arguments); |
- if (results['help'] || results.rest.length == 0) { |
- showUsage(parser); |
- return null; |
- } |
- return new PreprocessorOptions.fromArgs(results); |
- } on FormatException catch (e) { |
- print(e.message); |
- showUsage(parser); |
- return null; |
- } |
- } |
- |
- static showUsage(parser) { |
- print('Usage: css [options...] input.css'); |
- print(parser.getUsage()); |
- } |
} |