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

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

Issue 363083002: Allow defining a help string for an option's parameter value. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
Index: pkg/args/lib/src/usage.dart
diff --git a/pkg/args/lib/src/usage.dart b/pkg/args/lib/src/usage.dart
index a431395ff4f91df5375d403f1550f21e8e175ae6..11be54b38983900ea14ddf0c9223bcb20b2a6923 100644
--- a/pkg/args/lib/src/usage.dart
+++ b/pkg/args/lib/src/usage.dart
@@ -108,11 +108,16 @@ class Usage {
}
String getLongOption(Option option) {
+ var result;
if (option.negatable) {
- return '--[no-]${option.name}';
+ result = '--[no-]${option.name}';
} else {
- return '--${option.name}';
+ result = '--${option.name}';
}
+
+ if (option.valueHelp != null) result += "=<${option.valueHelp}>";
+
+ return result;
}
String getAllowedTitle(String allowed) {
« pkg/args/README.md ('K') | « pkg/args/lib/src/options.dart ('k') | pkg/args/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698