Merge pull request #443 from polluks/patch-7

More POSIX.2, staying compatible
This commit is contained in:
Oliver Schmidt 2017-06-03 22:05:10 +02:00 committed by GitHub
commit 6549457929

View file

@ -62,9 +62,9 @@ static void Usage (void)
{ {
fprintf (stderr, "Usage: %s <operation ...> lib file|module ...\n" fprintf (stderr, "Usage: %s <operation ...> lib file|module ...\n"
"Operations are some of:\n" "Operations are some of:\n"
"\ta\tAdd modules\n" "\tr\tAdd modules\n"
"\td\tDelete modules\n" "\td\tDelete modules\n"
"\tl\tList library contents\n" "\tt\tList library table\n"
"\tv\tIncrease verbosity (put before other operation)\n" "\tv\tIncrease verbosity (put before other operation)\n"
"\tx\tExtract modules\n" "\tx\tExtract modules\n"
"\tV\tPrint the archiver version\n", "\tV\tPrint the archiver version\n",
@ -94,13 +94,10 @@ int main (int argc, char* argv [])
/* Get the argument */ /* Get the argument */
const char* Arg = ArgVec [I]; const char* Arg = ArgVec [I];
/* Check for an option */
if (strlen (Arg) != 1) {
Usage ();
}
switch (Arg [0]) { switch (Arg [0]) {
case 'a': case 'r': /* POSIX.2 */
case 'a': /* staying compatible */
AddObjFiles (ArgCount - I - 1, &ArgVec[I+1]); AddObjFiles (ArgCount - I - 1, &ArgVec[I+1]);
break; break;
@ -108,7 +105,11 @@ int main (int argc, char* argv [])
DelObjFiles (ArgCount - I - 1, &ArgVec [I+1]); DelObjFiles (ArgCount - I - 1, &ArgVec [I+1]);
break; break;
case 'l': case 't': /* POSIX.2 */
case 'l': /* staying compatible */
if (Arg [1] == 'v') {
++Verbosity;
}
ListObjFiles (ArgCount - I - 1, &ArgVec [I+1]); ListObjFiles (ArgCount - I - 1, &ArgVec [I+1]);
break; break;