# HG changeset patch # User Matti Hamalainen # Date 1578861677 -7200 # Node ID c8f52ea748039bb8d17613721dfab3f1eefbb2d6 # Parent 14a91c998d96fe1f958a28e345859924e0ddb791 More help cosmetics. diff -r 14a91c998d96 -r c8f52ea74803 sidinfo.c --- 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] [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 ) also sets escape characters\n" "(option -e ), if escape characters have NOT been separately set.\n"