MCPcopy Create free account
hub / github.com/columbia/egalito / helpCommand

Method helpCommand

app/shell2/code.cpp:214–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214bool FullCommandList::helpCommand(ShellState &state, ArgumentValueList &args) const {
215 bool showFlags = args.getBool("-l");
216 if(args.getIndexedCount() >= 1) {
217 auto name = args.getIndexed(0).getString();
218 if(auto command = lookup(name)) {
219 printHelpFor(command, showFlags, *args.getOutStream());
220 }
221 else {
222 (*args.getOutStream()) << "Error: command \""
223 << name << "\" does not exist\n";
224 }
225 }
226 else {
227 for(const auto &kv : commandMap) {
228 printHelpFor(kv.second, showFlags, *args.getOutStream());
229 }
230 }
231 return true;
232}
233
234#define PIPE_READ 0
235#define PIPE_WRITE 1

Callers

nothing calls this directly

Calls 5

printHelpForFunction · 0.85
getBoolMethod · 0.80
getIndexedCountMethod · 0.80
getStringMethod · 0.80
getOutStreamMethod · 0.80

Tested by

no test coverage detected