22#ifndef SCSL_COMMANDER_H
23#define SCSL_COMMANDER_H
48 CommandNotRegistered = 3,
58 : fn(func), args(argc), command(name)
62 std::string
Name() {
return this->command; }
104 std::map<std::string, Subcommand *> cmap;
Definition: Commander.h:93
Commander()
A Commander is initialized empty.
Definition: Commander.cc:29
Subcommand::Status Run(std::string command, int argc, char **argv)
Try to run a subcommand registered with this Commander.
Definition: Commander.cc:49
bool Register(Subcommand scmd)
Register adds the subcommand. It will be copied into the Commander.
Definition: Commander.cc:36
Definition: Commander.h:36
std::string Name()
Name returns the name of this subcommand.
Definition: Commander.h:62
Status Run(int argc, char **argv)
Definition: Commander.cc:14
Subcommand(std::string name, int argc, CommanderFunc func)
Definition: Commander.h:57
Status
Status describes the results of running a Subcommand.
Definition: Commander.h:39
scsl is the top-level namespace containing all the code in this library.
Definition: scsl.h:37
std::function< bool(int, char **)> CommanderFunc
Definition: Commander.h:31