MCPcopy Create free account
hub / github.com/apitrace/apitrace / list_commands

Function list_commands

cli/cli_main.cpp:130–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130static void
131list_commands(void) {
132 const Command *command;
133 int i, max_width = 0;
134
135 std::cout << "The available commands are as follows:\n\n";
136
137 std::cout << std::setiosflags(std::ios::left);
138
139 for (i = 0; i < ARRAY_SIZE(commands); i++) {
140 command = commands[i];
141 if (strlen(command->name) > max_width) {
142 max_width = strlen(command->name);
143 }
144 }
145
146 for (i = 0; i < ARRAY_SIZE(commands); i++) {
147 command = commands[i];
148
149 std::cout << " " << std::setw(max_width + 2) << command->name
150 << " " << command->synopsis << "\n";
151 }
152
153 std::cout << "\n"
154 "Use \"apitrace help <command>\" for more details on each command.\n";
155}
156
157
158static int

Callers 2

help_usageFunction · 0.85
usageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected