dart-lang / core

This repository is home to core Dart packages.
https://pub.dev/publishers/dart.dev
BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

args: Merge allowedHelp into allowed #123

Open DartBot opened 9 years ago

DartBot commented 9 years ago

Issue by seaneagan Originally opened as dart-lang/sdk#15705


Currently it looks something like:

  var allowed = {     'x': 'x help',     'y': 'y help',     'z': 'z help',   }

  parser.addOption('foo', allowed: allowed.keys.toList(), allowedHelp: allowed);

Nicer would be:

  parser.addOption('foo', allowed: {     'x': 'x help',     'y': 'y help',     'z': 'z help',   });

So allowed: would allow Iterable<String> or Map<String, String>

DartBot commented 9 years ago

Comment by floitschG


Added Area-Pkg, Triaged labels.

DartBot commented 9 years ago

Comment by sethladd


I wonder if the team would be open to a patch for this?


Removed Priority-Unassigned label. Added Priority-Low, Pkg-Args labels.

DartBot commented 9 years ago

Comment by srawlins


In order to make this a not breaking change, we could derive allowedHelp from allowed if allowed is a Map, but otherwise still accept an allowed List, and an allowedHelp.

nex3 commented 9 years ago

Personally I'm in favor of this.