MCPcopy Create free account
hub / github.com/SpacehuhnTech/SimpleCLI / addCmd

Method addCmd

src/SimpleCLI.cpp:231–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231void SimpleCLI::addCmd(Command& c) {
232 if (!cmdList) {
233 cmdList = c.cmdPointer;
234 } else {
235 cmd* h = cmdList;
236
237 while (h->next) h = h->next;
238 h->next = c.cmdPointer;
239 }
240
241 c.setCaseSensetive(caseSensetive);
242 c.persistent = true;
243}
244
245Command SimpleCLI::addCmd(const char* name, void (* callback)(cmd* c)) {
246 Command c(cmd_create_default(name));

Callers

nothing calls this directly

Calls 3

cmd_create_defaultFunction · 0.85
setCallbackMethod · 0.80
setCaseSensetiveMethod · 0.45

Tested by

no test coverage detected