[hackers] [sbase] tar: Remove support for old syntax (we now require '-' to parse flags) || sin
commit 2334c049528450e46062395b70b9460542000d60
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 Tue Mar 24 2015 - 23:53:18 CET
This archive was generated by hypermail 2.3.0
: Wed Mar 25 2015 - 00:03:29 CET