[#BloombergLP-balcl-OptionInfo]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balcl.adoc[balcl]::OptionInfo
:relfileprefix: ../../
:mrdocs:

This `struct` is a simple attribute class that describes the information associated with an option, namely the associated tag (as a string, from which the short and long tags are extracted), the option name, the description used in printing usage, and optional associated `TypeInfo` and `OccurrenceInfo` objects&period;

== Synopsis

Declared in `&lt;balcl&lowbar;optioninfo&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct OptionInfo;
----

== Description

By design, this `struct` does not have any user&hyphen;defined constructors, so there is no provision for passing an allocator to its data members (all of which take an allocator)&period; Consequently, all instances of this class use the default allocator&period; If proper allocator propagation is desired (e&period;g&period;, for storage within an allocator&hyphen;aware container for which the use of the default allocator is counter&hyphen;indicated), one may use `Option`, which is both allocator&hyphen;aware and constructible from `OptionInfo`&period;

The main purpose of this `struct` is to provide a type whose values can be statically&hyphen;initialized&period; For example&colon; &grave; const balcl&colon;&colon;OptionInfo OPTIONS&lsqb;&rsqb;&equals; &lcub; &lcub; &quot;s&verbar;longTag&quot;, &sol;&sol; s(hortTag) &quot;optionName&quot;, &quot;option description&quot;, balcl&colon;&colon;TypeInfo(&sol;&ast; &period; &period; &period; &ast;&sol;), &sol;&sol; optional balcl&colon;&colon;OccurrenceInfo(&sol;&ast; &period; &period; &period; &ast;&sol;) &sol;&sol; optional &rcub;, &sol;&sol; &period;&period;&period; &rcub;&semi; &grave; Note that each of the first three fields can be default&hyphen;constructed, and thus omitted in such a declaration&semi; however, such an object will be of limited use because, to avoid undefined behavior, the constructor of `balcl&colon;&colon;CommandLine` requires that each of these fields be acceptable to the `isDescriptionValid`, `isNameValid`, and `isTagValid` methods of `balcl&colon;&colon;Option`&period; The default string value is not acceptable to any of those methods&period; See the &lcub;Usage&rcub; section for an example of such initialization&period;

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/OptionInfo/ArgType.adoc[`ArgType`] 
| Enumerate the categories of command&hyphen;line arguments&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/OptionInfo/2constructor-0af.adoc[`OptionInfo`]         [.small]#[constructor]#
| Constructors
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/OptionInfo/d_defaultInfo.adoc[`d&lowbar;defaultInfo`] 
| Optional default&hyphen;occurrence information&colon; whether the option is required, optional, or hidden (default is optional), and optionally a default value&period;
| xref:BloombergLP/balcl/OptionInfo/d_description.adoc[`d&lowbar;description`] 
| description used in printing usage
| xref:BloombergLP/balcl/OptionInfo/d_environmentVariableName.adoc[`d&lowbar;environmentVariableName`] 
| Optional environment variable name supplying a default value&period;
| xref:BloombergLP/balcl/OptionInfo/d_name.adoc[`d&lowbar;name`] 
| accessing name
| xref:BloombergLP/balcl/OptionInfo/d_tag.adoc[`d&lowbar;tag`] 
| tags (or &quot;&quot; for non&hyphen;option argument)
| xref:BloombergLP/balcl/OptionInfo/d_typeInfo.adoc[`d&lowbar;typeInfo`] 
| Optional type and linked&hyphen;variable information for the option value&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/operator_not_eq-03.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` do not have the same value, and `false` otherwise&period; Two `OptionInfo` object do not have the same value if they do not have the same tag strings, or the same names, or the same descriptions, or the same type information, or the same occurrence information&period;
| xref:BloombergLP/balcl/operator_eq-0b2.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` have the same value, and `false` otherwise&period; Two `OptionInfo` objects have the same value if they have the same tag string, the same name, the same description, the same type info, and the same occurrence info values&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
