comparison tools/packed.c @ 2438:0b18f597351a

Cosmetics in help.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 25 Feb 2020 09:40:23 +0200
parents 69a5af2eb1ea
children f81b42dd600d
comparison
equal deleted inserted replaced
2437:f7d54ac51880 2438:0b18f597351a
66 static const int optListN = sizeof(optList) / sizeof(optList[0]); 66 static const int optListN = sizeof(optList) / sizeof(optList[0]);
67 67
68 68
69 void argShowHelp() 69 void argShowHelp()
70 { 70 {
71 dmPrintBanner(stdout, dmProgName, "<command> [options] <packfile> [<filename(s)>]"); 71 FILE *fh = stdout;
72
73 dmPrintBanner(fh, dmProgName, "<command> [options] <packfile> [<filename(s)>]");
74
75 fprintf(fh, "\n");
72 76
73 for (int i = 0; i < cmdListN; i++) 77 for (int i = 0; i < cmdListN; i++)
74 { 78 {
75 const DMOptArg *cmd = &cmdList[i]; 79 const DMOptArg *cmd = &cmdList[i];
76 char tmpStr[128]; 80 char tmpStr[128];
77 snprintf(tmpStr, sizeof(tmpStr), "%c / %s", 81 snprintf(tmpStr, sizeof(tmpStr), "%c / %s",
78 cmd->o_short, cmd->o_long); 82 cmd->o_short, cmd->o_long);
79 83
80 fprintf(stdout, " %-15s %s\n", tmpStr, cmd->desc); 84 fprintf(fh, " %-15s %s\n", tmpStr, cmd->desc);
81 } 85 }
82 86
83 fprintf(stdout, "\n"); 87 fprintf(fh, "\n");
84 88
85 dmArgsPrintHelp(stdout, optList, optListN, 0, 80 - 2); 89 dmArgsPrintHelp(fh, optList, optListN, 0, 80 - 2);
86 90
87 fprintf(stdout, 91 fprintf(fh,
88 "\n" 92 "\n"
89 "Examples:\n" 93 "Examples:\n"
90 "$ %s l test.pak -- list files in test.pak\n" 94 "$ %s l test.pak -- list files in test.pak\n"
91 "$ %s c test.pak foobar.jpg -- create test.pak and add foobar.jpg in it\n" 95 "$ %s c test.pak foobar.jpg -- create test.pak and add foobar.jpg in it\n"
92 "$ %s e test.pak foobar.jpg -- extract foobar.jpg from test.pak\n", 96 "$ %s e test.pak foobar.jpg -- extract foobar.jpg from test.pak\n",