folly::cli_apply_args_files_receiver

Callback interface receiving events while expanding args-files.

Synopsis

Declared in <folly/cli/Args.h>

class cli_apply_args_files_receiver;

Types

NameDescription
human_location A human-readable line and column position within an args-file.
location The full location of an entry within the arg-list or an args-file.

Enums

NameDescription
control Result telling the expander how to continue after a plain term.
cycle Result telling the expander how to handle a detected file cycle.
found Result telling the expander what to do with an args-file argument.
term_error Reason an argument term failed to parse.

Member Functions

NameDescription
~cli_apply_args_files_receiver [destructor] [virtual]Destroys the receiver.
on_file_cycle [virtual]Called when an argument is an args-file that would create a cycle (directly or indirectly). The file parameter is the original filename from the argument, and canonical_path is the resolved path that was detected as part of a cycle.
on_file_enter [virtual]Called when an argument is an args-file, the file was read successfully, and control recurses into the args-file. Is passed ownership of the filename.
on_file_error [virtual]Called when an argument is an args-file, but the file could not be read. Is passed ownership of the filename.
on_file_found [virtual]Called when an argument is an args-file. Returns whether to expand it.
on_file_leave [virtual]Called when control recurses out of an args-file. Calls to on_file_enter and on_file_leave are balanced in pairs.
on_term [virtual]Called when an argument is just a string. Is passed ownership of the string.
on_term_error [virtual]Called when an argument fails to parse (e.g., unclosed quotes). term_loc is the location of the term containing the error. error_loc is the location where the error begins within that term. Parsing of the current file stops, but parent files continue.

Non-Member Functions

NameDescription
cli_apply_args_filesApplies args-file expansion to a list of arguments. Uses the receiver interface for full control over processing.