Filled in some missing long options for command line tools that use long options.

This commit is contained in:
Michael Ossmann
2017-01-29 18:32:11 -07:00
parent f494e0b890
commit 0b061134b0
4 changed files with 12 additions and 8 deletions

View File

@ -45,6 +45,7 @@ uint8_t data[MAX_XSVF_LENGTH];
static struct option long_options[] = {
{ "xsvf", required_argument, 0, 'x' },
{ "device", required_argument, 0, 'd' },
{ "help", no_argument, 0, 'h' },
{ 0, 0, 0, 0 },
};
@ -82,7 +83,7 @@ static void usage()
printf("Usage:\n");
printf("\t-h, --help: this help\n");
printf("\t-x, --xsvf <filename>: XSVF file to be written to CPLD.\n");
printf("\t-d <serialnumber>: Serial number of device, if multiple devices\n");
printf("\t-d, --device <serialnumber>: Serial number of device, if multiple devices\n");
}
int main(int argc, char** argv)

View File

@ -39,13 +39,14 @@ static void usage() {
printf("\t-o, --address <n>: specify a particular operacake by address [default: 0x00]\n");
printf("\t-a <n>: set port A connection\n");
printf("\t-b <n>: set port B connection\n");
printf("\t-v: verbose, list available operacake boards\n");
printf("\t-v, --verbose: verbose, list available operacake boards\n");
}
static struct option long_options[] = {
{ "device", no_argument, 0, 'd' },
{ "serial", no_argument, 0, 's' },
{ "address", no_argument, 0, 'o' },
{ "verbose", no_argument, 0, 'v' },
{ "help", no_argument, 0, 'h' },
{ 0, 0, 0, 0 },
};

View File

@ -38,7 +38,7 @@ static void usage() {
printf("\t-n, --register <n>: set register number for subsequent read/write operations\n");
printf("\t-r, --read: read register specified by last -n argument, or all registers\n");
printf("\t-w, --write <v>: write register specified by last -n argument with value <v>\n");
printf("\t-s, --device <s>: specify a particular device by serial number\n");
printf("\t-s, --serial <s>: specify a particular device by serial number\n");
printf("\t-d, --device <n>: specify a particular device by number\n");
printf("\nExamples:\n");
printf("\t<command> -n 12 -r # reads from register 12\n");

View File

@ -51,6 +51,8 @@ static struct option long_options[] = {
{ "length", required_argument, 0, 'l' },
{ "read", required_argument, 0, 'r' },
{ "write", required_argument, 0, 'w' },
{ "device", required_argument, 0, 'd' },
{ "reset", no_argument, 0, 'R' },
{ "verbose", no_argument, 0, 'v' },
{ "help", no_argument, 0, 'h' },
{ 0, 0, 0, 0 },
@ -90,11 +92,11 @@ static void usage()
printf("\t-h, --help: this help\n");
printf("\t-a, --address <n>: starting address (default: 0)\n");
printf("\t-l, --length <n>: number of bytes to read (default: %d)\n", MAX_LENGTH);
printf("\t-r <filename>: Read data into file.\n");
printf("\t-w <filename>: Write data from file.\n");
printf("\t-d <serialnumber>: Serial number of device, if multiple devices\n");
printf("\t-R: Reset HackRF after other operations.\n");
printf("\t-v: Verbose output.\n");
printf("\t-r, --read <filename>: Read data into file.\n");
printf("\t-w, --write <filename>: Write data from file.\n");
printf("\t-d, --device <serialnumber>: Serial number of device, if multiple devices\n");
printf("\t-R, --reset: Reset HackRF after other operations.\n");
printf("\t-v, --verbose: Verbose output.\n");
}
int main(int argc, char** argv)