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

Unified Diff: pkg/args/README.md

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/README.md
diff --git a/pkg/args/README.md b/pkg/args/README.md
index fe31554cba93d95e5f433ba50a3ac5a69e93fe6d..329e20c24725461922ddbf460f8a22baf13cacd5 100644
--- a/pkg/args/README.md
+++ b/pkg/args/README.md
@@ -209,6 +209,11 @@ To define help text for an entire option, use the `help:` parameter:
allowed: ['debug', 'release']);
parser.addFlag('verbose', help: 'Show additional diagnostic info');
+For non-flag options, you can also provide a help string for the parameter:
nweiz 2014/07/02 19:41:32 "help string" -> "name"
Bob Nystrom 2014/07/07 20:37:34 I think I like "help string" here. I want people t
nweiz 2014/07/07 20:52:00 Again, I think "help" is strongly tied to prose de
+
+ parser.addOption('out', help: 'The output path', helpValue: 'path',
+ allowed: ['debug', 'release']);
+
For non-flag options, you can also provide detailed help for each expected value
by using the `allowedHelp:` parameter:
@@ -227,16 +232,12 @@ The resulting string looks something like this:
--mode The compiler configuration
[debug, release]
+ --out=<path> The output path
--[no-]verbose Show additional diagnostic info
--arch The architecture to compile for
-
[arm] ARM Holding 32-bit chip
[ia32] Intel x86
-To assist the formatting of the usage help, single-line help text is followed by
-a single new line. Options with multi-line help text are followed by two new
-lines. This provides spatial diversity between options.
nweiz 2014/07/02 19:41:32 This change should probably also be mentioned in t
Bob Nystrom 2014/07/07 20:37:34 There's no behavioral change here. I just took the
-
[posix]: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
[gnu]: http://www.gnu.org/prep/standards/standards.html#Command_002dLine-Interfaces
[ArgParser]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/args/args.ArgParser
« pkg/args/CHANGELOG.md ('K') | « pkg/args/CHANGELOG.md ('k') | pkg/args/lib/args.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698