$darkmode
#include <command.hpp>
Public Types | |
| enum class | Mode { Sync , Async , Detach } |
| enum class | Verbosity { Never , OnError , Always } |
Public Member Functions | |
| Command (const std::string &command) | |
| Command (boost::filesystem::path executable, std::initializer_list< std::string > args) | |
| boost::filesystem::path | executable () const |
| const std::vector< std::string > & | args () const |
| std::string | command () const |
| Verbosity | verbosity () const |
| Command | verbosity (Verbosity v) && |
| void | set_verbosity (Verbosity v) |
| Mode | mode () const |
| Command | mode (Mode m) && |
| void | set_mode (Mode m) |
| Command | sync () && |
| bool | is_sync () const |
| Command | async () && |
| bool | is_async () const |
| Command | detach () && |
| bool | is_detach () const |
| bool | ignore_failure () const |
| Command | ignore_failure (bool v) && |
| void | set_ignore_failure (bool v) |
| CONFABLE_SCHEMA (Command) | |
| void | from_conf (const Conf &c) override |
Public Member Functions inherited from fable::Confable | |
| Confable (const Confable &) noexcept | |
| Confable (Confable &&) noexcept=default | |
| Confable & | operator= (const Confable &other) noexcept |
| Confable & | operator= (Confable &&other) noexcept |
| virtual void | reset_schema () |
| Schema & | schema () |
| const Schema & | schema () const |
| virtual void | validate_or_throw (const Conf &c) const |
| virtual bool | validate (const Conf &c, std::optional< SchemaError > &err) const |
| virtual void | to_json (Json &j) const |
| Json | to_json () const |
Additional Inherited Members | |
Protected Member Functions inherited from fable::Confable | |
| virtual Schema | schema_impl () |
Command describes the execution of a command.
There are two ways a command can normally be executed:
Shell execution includes the interpretation of all sorts of symbols and may include functions that are only available to the shell itself. For these commands, no validation can occur pre-execution.
|
strong |
|
strong |
|
inline |
Return the executable arguments.
| std::string cloe::Command::command | ( | ) | const |
Return the command as a string.
This does not necessarily have the correct characters escaped so as to be result in the same execution when pasted into a shell.
|
inline |
Return the executable.
|
overridevirtual |
Deserialize a Confable from a Conf.
Unless you have special needs, it is recommended to implement
Schema schema_impl()
and use the default implementation of this.
Reimplemented from fable::Confable.