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

Unified Diff: pkg/args/lib/args.dart

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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/coreimpl/date.dart ('k') | pkg/dartdoc/lib/dartdoc.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/args/lib/args.dart
===================================================================
--- pkg/args/lib/args.dart (revision 13683)
+++ pkg/args/lib/args.dart (working copy)
@@ -230,8 +230,8 @@
* * There is already an option named [name].
* * There is already an option using abbreviation [abbr].
*/
- void addFlag(String name, [String abbr, String help, bool defaultsTo = false,
- bool negatable = true, void callback(bool value)]) {
+ void addFlag(String name, {String abbr, String help, bool defaultsTo: false,
+ bool negatable: true, void callback(bool value)}) {
_addOption(name, abbr, help, null, null, defaultsTo, callback,
isFlag: true, negatable: negatable);
}
@@ -251,8 +251,8 @@
void _addOption(String name, String abbr, String help, List<String> allowed,
Map<String, String> allowedHelp, defaultsTo,
- void callback(value), [bool isFlag, bool negatable = false,
- bool allowMultiple = false]) {
+ void callback(value), {bool isFlag, bool negatable: false,
+ bool allowMultiple: false}) {
// Make sure the name isn't in use.
if (_options.containsKey(name)) {
throw new ArgumentError('Duplicate option "$name".');
@@ -560,8 +560,8 @@
final bool allowMultiple;
_Option(this.name, this.abbreviation, this.help, this.allowed,
- this.allowedHelp, this.defaultValue, this.callback, [this.isFlag,
- this.negatable, this.allowMultiple = false]);
+ this.allowedHelp, this.defaultValue, this.callback, {this.isFlag,
+ this.negatable, this.allowMultiple: false});
}
/**
« no previous file with comments | « lib/coreimpl/date.dart ('k') | pkg/dartdoc/lib/dartdoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698