OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library csslib.src.options; | 5 library csslib.src.options; |
6 | 6 |
7 import 'package:args/args.dart'; | 7 import 'package:args/args.dart'; |
8 | 8 |
9 class PreprocessorOptions { | 9 class PreprocessorOptions { |
10 /** Generate polyfill code (e.g., var, etc.) */ | 10 /** Generate polyfill code (e.g., var, etc.) */ |
(...skipping 22 matching lines...) Expand all Loading... |
33 * time. Essentially a directive e.g., @var-name. | 33 * time. Essentially a directive e.g., @var-name. |
34 */ | 34 */ |
35 final bool lessSupport; | 35 final bool lessSupport; |
36 | 36 |
37 /** Whether to use colors to print messages on the terminal. */ | 37 /** Whether to use colors to print messages on the terminal. */ |
38 final bool useColors; | 38 final bool useColors; |
39 | 39 |
40 /** File to process by the compiler. */ | 40 /** File to process by the compiler. */ |
41 final String inputFile; | 41 final String inputFile; |
42 | 42 |
43 const PreprocessorOptions({this.verbose: false, this.checked: false, | 43 const PreprocessorOptions( |
44 this.lessSupport: true, this.warningsAsErrors: false, | 44 {this.verbose: false, |
45 this.throwOnErrors: false, this.throwOnWarnings: false, | 45 this.checked: false, |
46 this.useColors: true, this.polyfill: false, this.inputFile}); | 46 this.lessSupport: true, |
| 47 this.warningsAsErrors: false, |
| 48 this.throwOnErrors: false, |
| 49 this.throwOnWarnings: false, |
| 50 this.useColors: true, |
| 51 this.polyfill: false, |
| 52 this.inputFile}); |
47 | 53 |
48 PreprocessorOptions.fromArgs(ArgResults args) | 54 PreprocessorOptions.fromArgs(ArgResults args) |
49 : warningsAsErrors = args['warnings_as_errors'], | 55 : warningsAsErrors = args['warnings_as_errors'], |
50 throwOnWarnings = args['throw_on_warnings'], | 56 throwOnWarnings = args['throw_on_warnings'], |
51 throwOnErrors = args['throw_on_errors'], | 57 throwOnErrors = args['throw_on_errors'], |
52 verbose = args['verbose'], | 58 verbose = args['verbose'], |
53 checked = args['checked'], | 59 checked = args['checked'], |
54 lessSupport = args['less'], | 60 lessSupport = args['less'], |
55 useColors = args['colors'], | 61 useColors = args['colors'], |
56 polyfill = args['polyfill'], | 62 polyfill = args['polyfill'], |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 showUsage(parser); | 108 showUsage(parser); |
103 return null; | 109 return null; |
104 } | 110 } |
105 } | 111 } |
106 | 112 |
107 static showUsage(parser) { | 113 static showUsage(parser) { |
108 print('Usage: css [options...] input.css'); | 114 print('Usage: css [options...] input.css'); |
109 print(parser.getUsage()); | 115 print(parser.getUsage()); |
110 } | 116 } |
111 } | 117 } |
OLD | NEW |