[#BloombergLP-balcl-CommandLine-parse-05] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balcl.adoc[balcl]::xref:BloombergLP/balcl/CommandLine.adoc[CommandLine]::parse :relfileprefix: ../../../ :mrdocs: `parse` overloads == Synopses Declared in `<balcl_commandline.h>` Parse the command‐line arguments contained in the array starting at the specified `argv` having the specified `argc` length. Optionally specify an `errorStream` to which an appropriate error message is written if parsing fails. If `errorStream` is not specified, `bsl::cerr` is used. Return 0 on success, and a non‐zero value otherwise. If an argument is not specified on the command‐line, then if the `Option` object configuration for this `CommandLine` defines an environment variable name and the runtime environment for this application has set that environment variable, then set the option to the value of the environment variable. Otherwise, if an option is not set by the command line, or the environment, set the option using the default value if one has been provided. If the option has not been set by the command line, environment, or by default, `hasValue` for the option will return `false`. After a successful call `isParsed()` and `isValid()` will both be `true`, and the information provided by `argv` can be viewed via the accessors. After an unsuccessful call `isParsed()` and `isValid()` will both be `false`. The behavior is undefined unless `isValid()` is `true` and `isParsed()` is `false` (i.e. the `CommandLine` was constructed in a valid state, and `parse` has not previously been called). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:BloombergLP/balcl/CommandLine/parse-0c.adoc[parse]( int argc, char const const* argv[]); ---- [.small]#xref:BloombergLP/balcl/CommandLine/parse-0c.adoc[_» more..._]# Parse the command‐line arguments contained in the array starting at the specified `argv` having the specified `argc` length, writing any error message to the specified `errorStream`. Return 0 on success, and a non‐zero value otherwise. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:BloombergLP/balcl/CommandLine/parse-00.adoc[parse]( int argc, char const const* argv[], std::ostream& errorStream); ---- [.small]#xref:BloombergLP/balcl/CommandLine/parse-00.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#