| 128 | } |
| 129 | |
| 130 | static void |
| 131 | list_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 | |
| 158 | static int |
no outgoing calls
no test coverage detected