folly::settings::parseCommandLineArguments

Main function to parse arguments folly::settings. This function parses command line arguments into folly::settings. It moves all positional, --help, not recognized flags and their values to the end of the argv array. It stops parsing arguments after '--' is encoutered.

Synopsis

Declared in <folly/settings/CommandLineParser.h>

ArgParsingResult
parseCommandLineArguments(
    int& argc,
    char**& argv,
    std::string_view project = "",
    Snapshot* snapshot = nullptr,
    SettingsAccessorProxy::SettingAliases const& aliases = {});

Return Value

true if help flag was encountered

Parameters

NameDescription
argcnumber of arguments in command line
argvvector of command line arguments
snapshotfolly::settings snapshot.
projectdefault project name for CLI parsing (default: "")
aliasesmap of aliases for registered settings