[#absl-ParseAbseilFlagsOnly]
= xref:absl.adoc[absl]::ParseAbseilFlagsOnly
:relfileprefix: ../
:mrdocs:

Parses a list of command&hyphen;line arguments, passed in the `argc` and `argv&lsqb;&rsqb;` parameters, into a set of Abseil Flag values, returning any unparsed arguments in `positional&lowbar;args` and `unrecognized&lowbar;flags` output parameters&period;

== Synopsis

Declared in `&lt;absl&sol;flags&sol;parse&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
ParseAbseilFlagsOnly(
    int argc,
    char* argv[],
    std::vector&lt;char*&gt;& positional&lowbar;args,
    std::vector&lt;UnrecognizedFlag&gt;& unrecognized&lowbar;flags);
----

== Description

This function classifies all the arguments (including content of the flagfiles, if any) into one of the following groups&colon;

&ast; arguments specified as &quot;&hyphen;&hyphen;flag&equals;value&quot; or &quot;&hyphen;&hyphen;flag value&quot; that match registered or built&hyphen;in Abseil Flags&period; These are &quot;Abseil Flag arguments&period;&quot; &ast; arguments specified as &quot;&hyphen;&hyphen;flag&quot; that are unrecognized as Abseil Flags &ast; arguments that are not specified as &quot;&hyphen;&hyphen;flag&quot; are positional arguments &ast; arguments that follow the flag&hyphen;terminating delimiter (`&hyphen;&hyphen;`) are also treated as positional arguments regardless of their syntax&period;

All of the deduced Abseil Flag arguments are then parsed into their corresponding flag values&period; If any syntax errors are found in these arguments, the binary exits with code 1&period;

This function also handles Abseil Flags built&hyphen;in usage flags (e&period;g&period; &hyphen;&hyphen;help) if any were present on the command line&period;

All the remaining positional arguments including original program name (argv&lsqb;0&rsqb;) are are returned in the `positional&lowbar;args` output parameter&period;

All unrecognized flags that are not otherwise ignored are returned in the `unrecognized&lowbar;flags` output parameter&period; Note that the special `undefok` flag allows you to specify flags which can be safely ignored&semi; `undefok` specifies these flags as a comma&hyphen;separated list&period; Any unrecognized flags that appear within `undefok` will therefore be ignored and not included in the `unrecognized&lowbar;flag` output parameter&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *argc*
| The number of command&hyphen;line arguments, as passed to `main()`&period;
| *argv*
| The command&hyphen;line arguments, as passed to `main()`&period;
| *positional&lowbar;args*
| Receives the remaining positional arguments&period;
| *unrecognized&lowbar;flags*
| Receives the flags that were not recognized&period;
|===


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