Mercurial > hg > sidinfo
changeset 330:c8f52ea74803
More help cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 12 Jan 2020 22:41:17 +0200 |
parents | 14a91c998d96 |
children | e35e15f07c66 |
files | sidinfo.c |
diffstat | 1 files changed, 14 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/sidinfo.c Sun Jan 12 20:26:45 2020 +0200 +++ b/sidinfo.c Sun Jan 12 22:41:17 2020 +0200 @@ -141,7 +141,7 @@ void argShowHelp(void) { - int index, len; + int index, width; th_print_banner(stdout, th_prog_name, "[options] <sid file|path> [file|path #2 ..]"); th_args_help(stdout, optList, optListN, 0, 80 - 2); @@ -150,27 +150,31 @@ "\n" "Available fields:\n"); - for (len = index = 0; index < noptPSOptions; index++) + for (width = index = 0; index < noptPSOptions; index++) { const PSFOption *opt = &optPSOptions[index]; - len += strlen(opt->name) + 2; - if (len >= 80 - 2) + int len = strlen(opt->name) + 2; + width += len; + if (width >= 80 - 2) { printf("\n"); - len = 0; + width = len; } - printf("%s%s", opt->name, (index < noptPSOptions - 1) ? ", " : "\n\n"); + printf("%s%s", + opt->name, + (index < noptPSOptions - 1) ? ", " : "\n"); } printf( + "\n" "Example: %s -x -p -f hash,copyright somesidfile.sid\n" "\n" - "Format strings for '-F' option are composed of @fields@ that get\n" - "expanded to their value. Also, escape sequences \\r, \\n and \\t\n" - "can be used: -F \"hash=@hash@\\ncopy=@copyright@\\n\"\n" + "Format strings for '-F' option are composed of @fields@ that get expanded\n" + "to their value. Also, escape sequences \\r, \\n and \\t can be used:\n" + " -F \"hash=@hash@\\ncopy=@copyright@\\n\"\n" "\n" "The -F fields can be further formatted via printf-style specifiers:\n" - "-F \"@copyright:'%%-30s'@\"\n" + " -F \"@copyright:'%%-30s'@\"\n" "\n" "NOTE: One line output (-l <field separator>) also sets escape characters\n" "(option -e <chars>), if escape characters have NOT been separately set.\n"