[#llvm-cl] = xref:llvm.adoc[llvm]::cl :relfileprefix: ../ :mrdocs: This namespace contains all of the command line option processing machinery. It is intentionally a short name to make qualified usage concise. == Types [cols="1,4"] |=== | Name| Description | xref:llvm/cl/ExpansionContext.adoc[`ExpansionContext`] | Contains options that control response file expansion. | xref:llvm/cl/GenericOptionValue.adoc[`GenericOptionValue`] | Type‐erased base for comparing and printing stored option values. | xref:llvm/cl/LocationClass.adoc[`LocationClass`] | Option modifier that stores the parsed value in an external variable. | xref:llvm/cl/Option.adoc[`Option`] | Abstract base for a registered command‐line option. | xref:llvm/cl/OptionCategory.adoc[`OptionCategory`] | Named group used to organize options in categorized `‐help` output. | xref:llvm/cl/OptionDiffPrinter-02.adoc[`OptionDiffPrinter`] | Diff printer used when the parsed type differs from the option value type. | xref:llvm/cl/OptionEnumValue.adoc[`OptionEnumValue`] | A single named enum alternative for an enum‐valued command‐line option. | xref:llvm/cl/OptionValue-0b.adoc[`OptionValue`] | Typed holder for an option's assigned value (specialized per data type). | xref:llvm/cl/OptionValueBase-0c.adoc[`OptionValueBase`] | Default `OptionValue` implementation used when no value has been assigned. | xref:llvm/cl/OptionValueCopy-08.adoc[`OptionValueCopy`] | Stores a typed copy of an option's assigned value. | xref:llvm/cl/SubCommand.adoc[`SubCommand`] | Named subcommand that owns a set of options and is selected by argv. | xref:llvm/cl/SubCommandGroup.adoc[`SubCommandGroup`] | Group of subcommands that can be assigned to an option together. | xref:llvm/cl/ValuesClass.adoc[`ValuesClass`] | Modifier that registers a set of literal enum values on an option parser. | xref:llvm/cl/alias.adoc[`alias`] | Command‐line alias that forwards occurrences to another registered option. | xref:llvm/cl/aliasopt.adoc[`aliasopt`] | Modifier that binds an `alias` to the canonical option it forwards to. | xref:llvm/cl/applicator-00.adoc[`applicator`] | Helper that applies a command‐line option modifier to an option object. | xref:llvm/cl/basic_parser-0dc.adoc[`basic_parser`] | Typed wrapper around `basic_parser_impl` for parsed data type `DataType.` | xref:llvm/cl/basic_parser_impl.adoc[`basic_parser_impl`] | Non‐template base implementing shared option‐parser boilerplate. | xref:llvm/cl/bits.adoc[`bits`] | A bits command‐line option that sets enum‐valued flags in a bit vector. | xref:llvm/cl/bits_storage-02.adoc[`bits_storage`] | Storage for a multi‐bit enum option that updates an external unsigned bit mask. | xref:llvm/cl/cat.adoc[`cat`] | Option modifier that assigns an option to `Category` for `‐help` grouping. | xref:llvm/cl/cb.adoc[`cb`] | Option modifier that registers a callback invoked when the option is parsed. | xref:llvm/cl/desc.adoc[`desc`] | Option modifier that sets the help description shown in `‐help.` | xref:llvm/cl/extrahelp.adoc[`extrahelp`] | Modifier that appends `help` to the text printed after the standard `‐help` output when the program exits via the help path. | xref:llvm/cl/generic_parser_base.adoc[`generic_parser_base`] | Non‐template base for mapping parsers that register literal option values. | xref:llvm/cl/initializer.adoc[`initializer`] | Option modifier that sets a default initial value for an `opt.` | xref:llvm/cl/list.adoc[`list`] | A list command‐line option that accumulates parsed values of type `DataType.` | xref:llvm/cl/list_initializer.adoc[`list_initializer`] | Option modifier that sets default elements for a `list` option. | xref:llvm/cl/list_storage-0b.adoc[`list_storage`] | External‐storage helper for `cl::list;` appends parsed values via `cl::location.` | xref:llvm/cl/multi_val.adoc[`multi_val`] | Modifier that sets how many additional values a `list` option consumes. | xref:llvm/cl/opt.adoc[`opt`] | A scalar command‐line option storing a single parsed value of type `DataType.` | xref:llvm/cl/opt_storage-0c.adoc[`opt_storage`] | External‐storage helper for `cl::opt;` stores the value via `cl::location.` | xref:llvm/cl/parser-065b.adoc[`parser`] | Default mapping parser for custom / enum‐like option data types. | xref:llvm/cl/sub.adoc[`sub`] | Option modifier that assigns an option to a subcommand or subcommand group. | xref:llvm/cl/value_desc.adoc[`value_desc`] | Option modifier that sets the value placeholder shown in `‐help.` |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:llvm/cl/TokenizerCallback.adoc[`TokenizerCallback`] | String tokenization function type. Should be compatible with either Windows or Unix command line tokenizers. | xref:llvm/cl/VersionPrinterTy.adoc[`VersionPrinterTy`] | Function type used to print version information to a stream. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:llvm/cl/FormattingFlags.adoc[`FormattingFlags`] | Flags controlling how an option's name and value are formatted on the command line. | xref:llvm/cl/MiscFlags.adoc[`MiscFlags`] | Miscellaneous flags adjusting how an option is parsed. | xref:llvm/cl/NumOccurrencesFlag.adoc[`NumOccurrencesFlag`] | Flags controlling how many times an option may appear on the command line. | xref:llvm/cl/OptionHidden.adoc[`OptionHidden`] | Controls whether an option appears in `‐help` / `‐help‐hidden` output. | xref:llvm/cl/ValueExpected.adoc[`ValueExpected`] | Whether a separate value argument is required, optional, or forbidden. | xref:llvm/cl/boolOrDefault.adoc[`boolOrDefault`] | Tri‐state boolean used by options that may be unset, true, or false. |=== == Functions [cols="1,4"] |=== | Name| Description | xref:llvm/cl/AddExtraVersionPrinter.adoc[`AddExtraVersionPrinter`] | Register an additional version printer invoked after the default one. | xref:llvm/cl/AddLiteralOption.adoc[`AddLiteralOption`] | Adds a new option for parsing and provides the option it refers to. | xref:llvm/cl/ExpandResponseFiles-04.adoc[`ExpandResponseFiles`] | Expand response files in `Argv` using `Saver` and `Tokenizer.` | xref:llvm/cl/HideUnrelatedOptions-00.adoc[`HideUnrelatedOptions`] | `HideUnrelatedOptions` overloads | xref:llvm/cl/ParseCommandLineOptions.adoc[`ParseCommandLineOptions`] | Parse command‐line options from `argv` (and optionally `EnvVar).` | xref:llvm/cl/PrintHelpMessage.adoc[`PrintHelpMessage`] | This function just prints the help message, exactly the same way as if the ‐help or ‐help‐hidden option had been given on the command line. | xref:llvm/cl/PrintOptionValues.adoc[`PrintOptionValues`] | Print option values for `‐print‐options` / `‐print‐all‐options.` | xref:llvm/cl/PrintVersionMessage.adoc[`PrintVersionMessage`] | Print the registered version message to the standard output stream. | xref:llvm/cl/ProvidePositionalOption.adoc[`ProvidePositionalOption`] | Parse positional argument `Arg` with option handler `Handler.` | xref:llvm/cl/ResetAllOptionOccurrences.adoc[`ResetAllOptionOccurrences`] | Reset every option as if it had never appeared on the command line. | xref:llvm/cl/ResetCommandLineParser.adoc[`ResetCommandLineParser`] | Reset the command‐line parser to a state with no registered options. | xref:llvm/cl/SetVersionPrinter.adoc[`SetVersionPrinter`] | Override the default LLVM version printer used for `‐‐version.` | xref:llvm/cl/TokenizeGNUCommandLine.adoc[`TokenizeGNUCommandLine`] | Tokenize a GNU‐style command line that may contain escapes and quotes. | xref:llvm/cl/TokenizeWindowsCommandLine.adoc[`TokenizeWindowsCommandLine`] | Tokenizes a string of Windows command line arguments, which may contain quotes and escaped quotes. | xref:llvm/cl/TokenizeWindowsCommandLineFull.adoc[`TokenizeWindowsCommandLineFull`] | Tokenize a full Windows command line, including the leading command name. | xref:llvm/cl/TokenizeWindowsCommandLineNoCopy.adoc[`TokenizeWindowsCommandLineNoCopy`] | Tokenize a Windows command line while avoiding copies when possible. | xref:llvm/cl/apply-0cf.adoc[`apply`] | `apply` overloads | xref:llvm/cl/callback.adoc[`callback`] | Build a `cb` modifier from callable `CB.` | xref:llvm/cl/expandResponseFiles-0c.adoc[`expandResponseFiles`] | `expandResponseFiles` overloads | xref:llvm/cl/getCompilerBuildConfig.adoc[`getCompilerBuildConfig`] | Return enabled LLVM build‐configuration tags such as `+assertions.` | xref:llvm/cl/getGeneralCategory.adoc[`getGeneralCategory`] | Return the default option category used when none is specified. | xref:llvm/cl/getRegisteredOptions.adoc[`getRegisteredOptions`] | Return the map of registered named options for subcommand `Sub.` | xref:llvm/cl/getRegisteredSubcommands.adoc[`getRegisteredSubcommands`] | Use this to get all registered SubCommands from the provided parser. | xref:llvm/cl/init.adoc[`init`] | Build an `initializer` modifier for default value `Val.` | xref:llvm/cl/list_init.adoc[`list_init`] | Build a `list_initializer` modifier for default elements `Vals.` | xref:llvm/cl/location.adoc[`location`] | Build a `LocationClass` modifier that stores the option value in `L` instead of in the option object itself. | xref:llvm/cl/printBuildConfig.adoc[`printBuildConfig`] | Print the compiler build configuration to `OS.` | xref:llvm/cl/printOptionDiff-00.adoc[`printOptionDiff`] | `printOptionDiff` overloads | xref:llvm/cl/tokenizeConfigFile.adoc[`tokenizeConfigFile`] | Tokenizes content of configuration file. | xref:llvm/cl/values.adoc[`values`] | Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to the ValuesClass constructor. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#