vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function readOption

Finds and reads an option from the configuration file or command line.

bool readOption(T) (
  string names,
  T* pvalue,
  string help_text
)
if (isOptionValue!T || is(T : E[], E) && isOptionValue!E);

Command line options take precedence over configuration file entries.

Parameters

NameDescription
names Option names. Separate multiple name variants with "|", as for std.getopt.
pvalue Pointer to store the value. Unchanged if value was not found.
help_text Text to be displayed when the application is run with --help.

Returns

true if the value was found, false otherwise.

See Also

readRequiredOption

Authors

Sönke Ludwig, Vladimir Panteleev

Copyright

© 2012-2016 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.