hosted/cli: Cleaned up the information print out code so we only make one call for the whole thing

This commit is contained in:
dragonmux 2022-06-04 21:35:13 -04:00 committed by Piotr Esden-Tempski
parent af0d597fb0
commit 19c2e56f13
1 changed files with 62 additions and 59 deletions

View File

@ -130,65 +130,68 @@ static void bmp_munmap(struct mmap_data *map)
static void cl_help(char **argv) static void cl_help(char **argv)
{ {
bmp_ident(NULL); bmp_ident(NULL);
PRINT_INFO("\n"); PRINT_INFO(
PRINT_INFO("Usage: %s [-h | -l | [-vBITMASK] [-d PATH | -P NUMBER | -s SERIAL | -c TYPE]\n", argv[0]); "\n"
PRINT_INFO(" [-n NUMBER] [-j] [-C] [-t | -T] [-e] [-p] [-R[h]] [-H] [-M STRING ...]\n"); "Usage: %s [-h | -l | [-vBITMASK] [-d PATH | -P NUMBER | -s SERIAL | -c TYPE]\n"
PRINT_INFO(" [-E | -w | -V | -r] [-a ADDR] [-S number] [file]]\n"); " [-n NUMBER] [-j] [-C] [-t | -T] [-e] [-p] [-R[h]] [-H] [-M STRING ...]\n"
PRINT_INFO("\n"); " [-E | -w | -V | -r] [-a ADDR] [-S number] [file]]\n"
PRINT_INFO("Single-shot and verbosity options [-h | -l | -vBITMASK]:\n"); "\n"
PRINT_INFO("\t-h Show the version version and this help, then exit\n"); "Single-shot and verbosity options [-h | -l | -vBITMASK]:\n"
PRINT_INFO("\t-l List available supported probes\n"); "\t-h Show the version version and this help, then exit\n"
PRINT_INFO("\t-v<bitmask> Set the output verbosity level based on some combination of:\n"); "\t-l List available supported probes\n"
PRINT_INFO("\t 1 = INFO, 2 = GDB, 4 = TARGET, 8 = PROBE, 16 = WIRE\n"); "\t-v<bitmask> Set the output verbosity level based on some combination of:\n"
PRINT_INFO("\n"); "\t 1 = INFO, 2 = GDB, 4 = TARGET, 8 = PROBE, 16 = WIRE\n"
PRINT_INFO("Probe selection arguments [-d PATH | -P NUMBER | -s SERIAL | -c TYPE]:\n"); "\n"
PRINT_INFO("\t-d <path> Use a serial device at the given path (Deprecated!)\n"); "Probe selection arguments [-d PATH | -P NUMBER | -s SERIAL | -c TYPE]:\n"
PRINT_INFO("\t-P <number> Use the <number>th debug probe found while scanning the\n"); "\t-d <path> Use a serial device at the given path (Deprecated!)\n"
PRINT_INFO("\t system, see the output from list for the order\n"); "\t-P <number> Use the <number>th debug probe found while scanning the\n"
PRINT_INFO("\t-s <serial> Select the debug probe with the given serial number\n"); "\t system, see the output from list for the order\n"
PRINT_INFO("\t-c <type> Select the FTDI-based debug probe with of the given\n"); "\t-s <serial> Select the debug probe with the given serial number\n"
PRINT_INFO("\t type (cable)\n"); "\t-c <type> Select the FTDI-based debug probe with of the given\n"
PRINT_INFO("\n"); "\t type (cable)\n"
PRINT_INFO("The default is to start a debug server at localhost:2000\n"); "\n"
PRINT_INFO("General configuration options: [-n NUMBER] [-j] [-C] [-t | -T] [-e] [-p] [-R[h]]\n"); "The default is to start a debug server at localhost:2000\n"
PRINT_INFO(" [-H] [-M STRING ...]\n"); "General configuration options: [-n NUMBER] [-j] [-C] [-t | -T] [-e] [-p] [-R[h]]\n"
PRINT_INFO("\t-n <number> Select the target device at the given position in the\n"); " [-H] [-M STRING ...]\n"
PRINT_INFO("\t scan chain (use the -t option to get a scan chain listing)\n"); "\t-n <number> Select the target device at the given position in the\n"
PRINT_INFO("\t-j Use JTAG instead of SWD\n"); "\t scan chain (use the -t option to get a scan chain listing)\n"
PRINT_INFO("\t-C Connect to target under hardware reset\n"); "\t-j Use JTAG instead of SWD\n"
PRINT_INFO("\t-t Perform a chain scan and display information about the\n"); "\t-C Connect to target under hardware reset\n"
PRINT_INFO("\t conected devices\n"); "\t-t Perform a chain scan and display information about the\n"
PRINT_INFO("\t-T Perform continues read- or write-back of a value to allow\n"); "\t conected devices\n"
PRINT_INFO("\t measurement of protocol timing. Aborted by ^C\n"); "\t-T Perform continues read- or write-back of a value to allow\n"
PRINT_INFO("\t-e Assume external resistors for FTDI devices, that is having the\n"); "\t measurement of protocol timing. Aborted by ^C\n"
PRINT_INFO("\t FTDI chip connected through resistors to TMS, TDI and TDO\n"); "\t-e Assume external resistors for FTDI devices, that is having the\n"
PRINT_INFO("\t-p Power the target from the probe (if possible)\n"); "\t FTDI chip connected through resistors to TMS, TDI and TDO\n"
PRINT_INFO("\t-R[h] Reset the device. If followed by 'h', this will be done using\n"); "\t-p Power the target from the probe (if possible)\n"
PRINT_INFO("\t the hardware reset line instead of over the debug link\n"); "\t-R[h] Reset the device. If followed by 'h', this will be done using\n"
PRINT_INFO("\t-H Do not use the high level command API (bmp-remote)\n"); "\t the hardware reset line instead of over the debug link\n"
PRINT_INFO("\t-M <string> Run target-specific monitor commands. This option\n"); "\t-H Do not use the high level command API (bmp-remote)\n"
PRINT_INFO("\t can be repeated for as many commands you wish to run.\n"); "\t-M <string> Run target-specific monitor commands. This option\n"
PRINT_INFO("\t If the command contains spaces, use quotes around the\n"); "\t can be repeated for as many commands you wish to run.\n"
PRINT_INFO("\t complete command\n"); "\t If the command contains spaces, use quotes around the\n"
PRINT_INFO("\n"); "\t complete command\n"
PRINT_INFO("SWD-specific configuration options [-f FREQUENCY | -m TARGET]:\n"); "\n"
PRINT_INFO("\t-f <frequency> Set an operating frequency for SWD\n"); "SWD-specific configuration options [-f FREQUENCY | -m TARGET]:\n"
PRINT_INFO("\t-m <target> Use the given target ID for selection in SWD multi-drop\n"); "\t-f <frequency> Set an operating frequency for SWD\n"
PRINT_INFO("\n"); "\t-m <target> Use the given target ID for selection in SWD multi-drop\n"
PRINT_INFO("Flash operation selection options [-E | -w | -V | -r]:\n"); "\n"
PRINT_INFO("\t-E Erase the target device Flash\n"); "Flash operation selection options [-E | -w | -V | -r]:\n"
PRINT_INFO("\t-w Write the specified binary file to the target device\n"); "\t-E Erase the target device Flash\n"
PRINT_INFO("\t Flash (the default)\n"); "\t-w Write the specified binary file to the target device\n"
PRINT_INFO("\t-V Verify the target device Flash against the specified\n"); "\t Flash (the default)\n"
PRINT_INFO("\t binary file\n"); "\t-V Verify the target device Flash against the specified\n"
PRINT_INFO("\t-r Read the target device Flash\n"); "\t binary file\n"
PRINT_INFO("\n"); "\t-r Read the target device Flash\n"
PRINT_INFO("Flash operation modifiers options: [-a ADDR] [-S number] [FILE]\n"); "\n"
PRINT_INFO("\t-a <addr> Start address for the given Flash operation (defaults to\n"); "Flash operation modifiers options: [-a ADDR] [-S number] [FILE]\n"
PRINT_INFO("\t the start of Flash)\n"); "\t-a <addr> Start address for the given Flash operation (defaults to\n"
PRINT_INFO("\t-S <number> Number of bytes to work on in the Flash operation (default\n"); "\t the start of Flash)\n"
PRINT_INFO("\t is till the operation fails or is complete)\n"); "\t-S <number> Number of bytes to work on in the Flash operation (default\n"
PRINT_INFO("\t<file> Binary file to use in Flash operations\n"); "\t is till the operation fails or is complete)\n"
"\t<file> Binary file to use in Flash operations\n",
argv[0]
);
exit(0); exit(0);
} }