#include <example_command_line.hh>
Inheritance diagram for examples::CommandLine:
Public Member Functions | |
| virtual void | run (const int, const char *const *const, const std::string &client, const std::string &env_var, const std::string &env_prefix) |
Friends | |
| class | paludis::Singleton< CommandLine > |
Action arguments | |
|
| |
| paludis::args::ArgsGroup | action_args |
| paludis::args::SwitchArg | a_version |
| paludis::args::SwitchArg | a_help |
General arguments | |
|
| |
| paludis::args::ArgsGroup | general_args |
| paludis::args::LogLevelArg | a_log_level |
| paludis::args::StringArg | a_environment |
Program information | |
|
| |
| virtual std::string | app_name () const |
| virtual std::string | app_synopsis () const |
| virtual std::string | app_description () const |
This class provides basic command line handling for most examples.
Most Paludis clients should support at least '--help', '--version' and '--log-level'. If paludis::EnvironmentFactory is used to create the environment (as opposed to, say, paludis::NoConfigEnvironment), then '--environment' must also be an option.
Clients are free to use whichever command line handling library they prefer, but for convenience all Paludis core clients use a common utility library with a much simpler interface than that provided by overly C-ish getopt derivatives.
The command line is a singleton -- that is, only one instance of it exists globally. This avoids the need to pass around lots of parameters.
1.7.1