24typedef std::vector<string> Arguments;
30static const std::string address =
"<address>";
31static const std::string
boolean =
"{ true | false }";
32static const std::string command =
"<command>";
33static const std::string dst =
"<destination>";
34static const std::string ignores =
"<ignores>";
35static const std::string kb =
"<kb>";
36static const std::string nr =
"<nr>";
37static const std::string onoff =
"{ on | off }";
38static const std::string path =
"<path>";
39static const std::string process =
"<process>";
40static const std::string seconds =
"<seconds>";
41static const std::string value =
"<value>";
42static const std::string count =
"<count>";
43static const std::string sequence =
"<byte sequence>";
44static const std::string src =
"<source>";
45static const std::string volume =
"<volume>";
46static const std::string
string =
"<string>";
53 static std::vector<string> groups;
56 static std::stack<isize> groupStack;
68 std::pair<string, string> help;
71 std::vector<string> requiredArgs;
74 std::vector<string> optionalArgs;
77 std::vector<Command> subCommands;
80 std::function<void (Arguments&,
long)> callback =
nullptr;
94 void pushGroup(
const string &description,
const string &postfix =
":");
98 void add(
const std::vector<string> &tokens,
100 std::function<
void (Arguments&,
long)> func =
nullptr,
long param = 0);
102 void add(
const std::vector<string> &tokens,
103 std::pair<const string &, const string &> help,
104 std::function<
void (Arguments&,
long)> func =
nullptr,
long param = 0);
106 void add(
const std::vector<string> &tokens,
107 const std::vector<string> &args,
109 std::function<
void (Arguments&,
long)> func =
nullptr,
long param = 0);
111 void add(
const std::vector<string> &tokens,
112 const std::vector<string> &args,
113 std::pair<const string &, const string &> help,
114 std::function<
void (Arguments&,
long)> func =
nullptr,
long param = 0);
116 void add(
const std::vector<string> &tokens,
117 const std::vector<string> &requiredArgs,
118 const std::vector<string> &optionalArgs,
120 std::function<
void (Arguments&,
long)> func =
nullptr,
long param = 0);
122 void add(
const std::vector<string> &tokens,
123 const std::vector<string> &requiredArgs,
124 const std::vector<string> &optionalArgs,
125 std::pair<const string &, const string &> help,
126 std::function<
void (Arguments&,
long)> func =
nullptr,
long param = 0);
128 void clone(
const string &alias,
129 const std::vector<string> &tokens,
132 void clone(
const string &alias,
133 const std::vector<string> &tokens,
143 isize minArgs()
const {
return isize(requiredArgs.size()); }
144 isize optArgs()
const {
return isize(optionalArgs.size()); }
145 isize maxArgs()
const {
return minArgs() + optArgs(); }
148 const Command *seek(
const string& token)
const;
149 Command *seek(
const string& token);
150 const Command *seek(
const std::vector<string> &tokens)
const;
151 Command *seek(
const std::vector<string> &tokens);
154 std::vector<const Command *> filterPrefix(
const string& prefix)
const;
157 string autoComplete(
const string& token);
160 string usage()
const;
VirtualC64 project namespace.
Definition CmdQueue.cpp:16