[hackers] [sbase] tar: Remove support for old syntax (we now require '-' to parse flags) || sin
commit f959be8b713900873bcb9d5a47935b9e6b3b1ca0
Author: sin <sin_AT_2f30.org>
Date: Mon Jan 26 16:13:01 2015 +0000
tar: Remove support for old syntax (we now require '-' to parse flags)
diff --git a/tar.c b/tar.c
index 5adf52b..f84d98a 100644
--- a/tar.c
+++ b/tar.c
_AT_@ -271,10 +271,8 @@ xt(int (*fn)(char*, int, char[Blksiz]))
static void
usage(void)
{
- eprintf("usage: tar [-f tarfile] [-C dir] [-]j|z [-]x[m]|t\n"
- " tar [-f tarfile] [-C dir] [-]c dir\n"
- " tar [-C dir] cf tarfile dir\n"
- " tar [-C dir] j|z x[m]|tf tarfile\n");
+ eprintf("usage: tar [-f tarfile] [-C dir] -j|z -x[m]|t\n"
+ " tar [-f tarfile] [-C dir] -c dir\n"
}
int
_AT_@ -312,47 +310,6 @@ main(int argc, char *argv[])
usage();
} ARGEND;
- if (!mode) {
- if (argc < 1)
- usage();
-
- for (ap = argv[0]; *ap; ap++) {
- switch (*ap) {
- case 'x':
- case 'c':
- case 't':
- if (mode)
- usage();
- mode = *ap;
- break;
- case 'f':
- if (argc < 2)
- usage();
- argc--, argv++;
- file = argv[0];
- break;
- case 'C':
- if (argc < 2)
- usage();
- argc--, argv++;
- dir = argv[0];
- break;
- case 'm':
- mflag = 1;
- break;
- case 'j':
- case 'z':
- if (filtermode)
- usage();
- filtermode = *ap;
- break;
- default:
- usage();
- }
- }
- argc--, argv++;
- }
-
if (!mode || argc != (mode == 'c'))
usage();
Received on Mon Jan 26 2015 - 17:14:19 CET
This archive was generated by hypermail 2.3.0
: Mon Jan 26 2015 - 17:24:09 CET