commit 2334c049528450e46062395b70b9460542000d60
parent 1412d07b7d295a11eee37af010f2e5a5fb3a5f39
Author: sin <sin@2f30.org>
Date: Mon, 26 Jan 2015 16:13:01 +0000
tar: Remove support for old syntax (we now require '-' to parse flags)
Diffstat:
M | tar.c | | | 47 | ++--------------------------------------------- |
1 file changed, 2 insertions(+), 45 deletions(-)
diff --git a/tar.c b/tar.c
@@ -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
@@ -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();