|
paludis
Version 1.4.0
|
#include <args_handler.hh>
Inheritance diagram for paludis::args::ArgsHandler:Public Member Functions | |
| void | add_option (ArgsOption *const, const std::string &long_name, const char short_name= '\0') |
| void | remove_option (const std::string &long_name, const char short_name= '\0') |
| void | run (const int argc, const char *const *const argv, const std::string &client, const std::string &env_var, const std::string &env_prefix, const ArgsHandlerOptions &options=ArgsHandlerOptions()) |
| void | run (const std::shared_ptr< const Sequence< std::string > > &, const std::string &client, const std::string &env_var, const std::string &env_prefix, const ArgsHandlerOptions &options=ArgsHandlerOptions()) |
Protected Member Functions | |
| void | add_usage_line (const std::string &l) |
| void | add_environment_variable (const std::string &e, const std::string &desc) |
| void | add_example (const std::string &e, const std::string &desc) |
| void | add_note (const std::string &) |
| void | add_description_line (const std::string &l) |
| void | add_see_also (const std::string &, int section) |
| void | add (ArgsSection *const) |
| void | dump_to_stream (std::ostream &s) const |
| virtual void | post_run () |
Friends | |
| class | ArgsSection |
| std::ostream & | operator<< (std::ostream &, const ArgsHandler &) |
Basic operations | |
| ArgsHandler () | |
| virtual | ~ArgsHandler () |
| ArgsHandler (const ArgsHandler &)=delete | |
| ArgsHandler & | operator= (const ArgsHandler &)=delete |
Iterate over our parameters (non - and -- switches and their values) | |
|
typedef WrappedForwardIterator < ParametersConstIteratorTag, const std::string > | ParametersConstIterator |
| ParametersConstIterator | begin_parameters () const |
| ParametersConstIterator | end_parameters () const |
| bool | empty () const |
| const std::shared_ptr< const Sequence< std::string > > | separate_after_dashes_args () const PALUDIS_ATTRIBUTE((warn_unused_result)) |
About our application (for documentation) | |
| virtual std::string | app_name () const =0 |
| virtual std::string | man_section () const |
| virtual std::string | app_synopsis () const =0 |
| virtual std::string | app_description () const =0 |
Iterate over our usage lines (for documentation) | |
|
typedef WrappedForwardIterator < UsageLineConstIteratorTag, const std::string > | UsageLineConstIterator |
| UsageLineConstIterator | begin_usage_lines () const |
| UsageLineConstIterator | end_usage_lines () const |
Iterate over our environment lines (for documentation) | |
|
typedef WrappedForwardIterator < EnvironmentLineConstIteratorTag, const std::pair< std::string, std::string > > | EnvironmentLineConstIterator |
| EnvironmentLineConstIterator | begin_environment_lines () const |
| EnvironmentLineConstIterator | end_environment_lines () const |
Iterate over our examples (for documentation) | |
|
typedef WrappedForwardIterator < ExamplesConstIteratorTag, const std::pair< std::string, std::string > > | ExamplesConstIterator |
| ExamplesConstIterator | begin_examples () const |
| ExamplesConstIterator | end_examples () const |
Iterate over our sections | |
|
typedef WrappedForwardIterator < ArgsSectionsConstIteratorTag, const ArgsSection > | ArgsSectionsConstIterator |
| ArgsSectionsConstIterator | begin_args_sections () const |
| ArgsSectionsConstIterator | end_args_sections () const |
| ArgsSection * | main_options_section () PALUDIS_ATTRIBUTE((warn_unused_result)) |
Iterate over our notes | |
|
typedef WrappedForwardIterator < NotesIteratorTag, const std::string > | NotesIterator |
| NotesIterator | begin_notes () const |
| NotesIterator | end_notes () const |
Iterate over our extra description lines (for documentation) | |
|
typedef WrappedForwardIterator < DescriptionLineConstIteratorTag, const std::string > | DescriptionLineConstIterator |
| DescriptionLineConstIterator | begin_description_lines () const |
| DescriptionLineConstIterator | end_description_lines () const |
Iterate over our 'see also' lines | |
| |
|
typedef WrappedForwardIterator < SeeAlsoConstIteratorTag, const std::pair< std::string, int > > | SeeAlsoConstIterator |
| SeeAlsoConstIterator | begin_see_alsos () const |
| SeeAlsoConstIterator | end_see_alsos () const |
For use by ArgsVisitor | |
|
typedef WrappedForwardIterator < ArgsIteratorTag, std::string > | ArgsIterator |
Handles command line arguments.
|
protected |
Add an new ArgsSection (called by the ArgsSection constructor).
|
protected |
Add a new description.
|
protected |
Add a new environment line.
|
protected |
Add a new example.
|
protected |
Add a new note.
| void paludis::args::ArgsHandler::add_option | ( | ArgsOption * | const, |
| const std::string & | long_name, | ||
| const char | short_name = '\0' |
||
| ) |
Add an ArgsOption instance.
|
protected |
Add a 'see also' item.
|
protected |
Add a new usage line.
|
pure virtual |
Long description of what our application is.
Implemented in examples::CommandLine.
|
pure virtual |
What is our application name?
Implemented in examples::CommandLine.
|
pure virtual |
One line synopsis of what our application is.
Implemented in examples::CommandLine.
|
protected |
Dump, for –help output (called by operator<<).
| ArgsSection* paludis::args::ArgsHandler::main_options_section | ( | ) |
The 'Options' section.
Created if it does not exist.
|
inlinevirtual |
What is our application's Unix manual section?
|
protectedvirtual |
Called after run(), for convenience. Does nothing.
| void paludis::args::ArgsHandler::remove_option | ( | const std::string & | long_name, |
| const char | short_name = '\0' |
||
| ) |
Remove an ArgsOption instance.
| void paludis::args::ArgsHandler::run | ( | const int | argc, |
| const char *const *const | argv, | ||
| const std::string & | client, | ||
| const std::string & | env_var, | ||
| const std::string & | env_prefix, | ||
| const ArgsHandlerOptions & | options = ArgsHandlerOptions() |
||
| ) |
Parse command line arguments. The third argument is used to set PALUDIS_CLIENT. The fourth argument is the name of an environment variable holding arguments which are prepended to the command line arguments. The fifth argument is used as a prefix to export our command line via the environment.
| void paludis::args::ArgsHandler::run | ( | const std::shared_ptr< const Sequence< std::string > > & | , |
| const std::string & | client, | ||
| const std::string & | env_var, | ||
| const std::string & | env_prefix, | ||
| const ArgsHandlerOptions & | options = ArgsHandlerOptions() |
||
| ) |
Parse command line arguments. The third argument is used to set PALUDIS_CLIENT. The fourth argument is the name of an environment variable holding arguments which are prepended to the command line arguments. The fifth argument is used as a prefix to export our command line via the environment.
| const std::shared_ptr<const Sequence<std::string> > paludis::args::ArgsHandler::separate_after_dashes_args | ( | ) | const |
If aho_separate_after_dashes, everything after a – goes here.
|
friend |
Output an ArgsHandler to an ostream, for –help output.
1.8.3.1