Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: lib/src/arg_parser.dart

Issue 849023002: format code, removed unused variables and deprecated usage (Closed) Base URL: https://github.com/dart-lang/args.git@master
Patch Set: nits Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/command_runner.dart ('k') | lib/src/arg_results.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/arg_parser.dart
diff --git a/lib/src/arg_parser.dart b/lib/src/arg_parser.dart
index 03d8d3f55165197e7b297c6a070b5aced2a04655..8337c42f3c8ea3737e3f9aad0cdf0cdcaa67d803 100644
--- a/lib/src/arg_parser.dart
+++ b/lib/src/arg_parser.dart
@@ -33,18 +33,19 @@ class ArgParser {
/// after it finds an argument that is neither an option nor a command.
/// This allows options to be specified after regular arguments. Defaults to
/// `false`.
- factory ArgParser({bool allowTrailingOptions}) =>
- new ArgParser._(<String, Option>{}, <String, ArgParser>{},
- allowTrailingOptions: allowTrailingOptions);
+ factory ArgParser({bool allowTrailingOptions}) => new ArgParser._(
+ <String, Option>{}, <String, ArgParser>{},
+ allowTrailingOptions: allowTrailingOptions);
ArgParser._(Map<String, Option> options, Map<String, ArgParser> commands,
- {bool allowTrailingOptions}) :
- this._options = options,
- this.options = new UnmodifiableMapView(options),
- this._commands = commands,
- this.commands = new UnmodifiableMapView(commands),
- this.allowTrailingOptions = allowTrailingOptions != null ?
- allowTrailingOptions : false;
+ {bool allowTrailingOptions})
+ : this._options = options,
+ this.options = new UnmodifiableMapView(options),
+ this._commands = commands,
+ this.commands = new UnmodifiableMapView(commands),
+ this.allowTrailingOptions = allowTrailingOptions != null
+ ? allowTrailingOptions
+ : false;
/// Defines a command.
///
@@ -86,8 +87,8 @@ class ArgParser {
void _addOption(String name, String abbr, String help, String valueHelp,
List<String> allowed, Map<String, String> allowedHelp, defaultsTo,
- void callback(value), OptionType type, {bool negatable: false,
- bool hide: false}) {
+ void callback(value), OptionType type,
+ {bool negatable: false, bool hide: false}) {
// Make sure the name isn't in use.
if (_options.containsKey(name)) {
throw new ArgumentError('Duplicate option "$name".');
@@ -103,8 +104,8 @@ class ArgParser {
}
_options[name] = newOption(name, abbr, help, valueHelp, allowed,
- allowedHelp, defaultsTo, callback, type, negatable: negatable,
- hide: hide);
+ allowedHelp, defaultsTo, callback, type,
+ negatable: negatable, hide: hide);
}
/// Parses [args], a list of command-line arguments, matches them against the
« no previous file with comments | « lib/command_runner.dart ('k') | lib/src/arg_results.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698