Skip to content

Commit

Permalink
Improve argp usage in emv-decode
Browse files Browse the repository at this point in the history
Move documentation strings out of argp options and instead specify them
in the documentation parameter of struct argp.
  • Loading branch information
leonlynch committed Jun 4, 2024
1 parent 9b6de94 commit ea3a2c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/emv-decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ static struct argp_option argp_options[] = {
{ "iso8859-14", EMV_DECODE_ISO8859_14, NULL, OPTION_HIDDEN },
{ "iso8859-15", EMV_DECODE_ISO8859_15, NULL, OPTION_HIDDEN },

{ 0, 0, NULL, 0, "OPTION may only be _one_ of the above." },
{ 0, 0, NULL, 0, "INPUT is either a string of hex digits representing binary data, or \"-\" to read from stdin" },

{ "version", EMV_DECODE_VERSION, NULL, 0, "Display emv-utils version" },

// Hidden option for testing
Expand All @@ -180,7 +177,10 @@ static struct argp argp_config = {
argp_options,
argp_parser_helper,
"INPUT",
"Decode data and print it in a human readable format.",
"Decode data and print it in a human readable format."
"\v" // Print remaining text after options
"OPTION may only be _one_ of the above.\n\n"
"INPUT is either a string of hex digits representing binary data, or \"-\" to read from stdin",
};

// argp parser helper function
Expand Down

0 comments on commit ea3a2c8

Please sign in to comment.