mirror of
https://github.com/vasi/pixz
synced 2024-11-18 15:26:46 +00:00
List can be a filter too; update usage
This commit is contained in:
parent
86e0a1998c
commit
a1cd0e174e
3
Makefile
3
Makefile
@ -32,6 +32,9 @@ write: write.o common.o endian.o cpu.o
|
||||
read: read.o common.o endian.o
|
||||
$(LD) $@ $^ -llzma
|
||||
|
||||
pread: pread.o common.o endian.o
|
||||
$(LD) $@ $^ -llzma
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGS)
|
||||
|
||||
|
12
list.c
12
list.c
@ -8,10 +8,14 @@
|
||||
int main(int argc, char **argv) {
|
||||
char *progname = argv[0];
|
||||
|
||||
if (argc != 2)
|
||||
die("Usage: %s [-t] file", progname);
|
||||
if (!(gInFile = fopen(argv[1], "r")))
|
||||
die("Can't open input file");
|
||||
if (argc == 1) {
|
||||
gInFile = stdin;
|
||||
} else if (argc == 2) {
|
||||
if (!(gInFile = fopen(argv[1], "r")))
|
||||
die("Can't open input file");
|
||||
} else {
|
||||
die("Usage: %s [FILE]", progname);
|
||||
}
|
||||
|
||||
decode_index();
|
||||
lzma_index_iter iter;
|
||||
|
3
write.c
3
write.c
@ -82,6 +82,7 @@ static void write_file_index_buf(lzma_action action);
|
||||
#pragma mark FUNCTION DEFINITIONS
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char *progname = argv[0];
|
||||
debug("launch");
|
||||
|
||||
int ch;
|
||||
@ -111,7 +112,7 @@ int main(int argc, char **argv) {
|
||||
if (!(gOutFile = fopen(argv[2], "w")))
|
||||
die("Can't open output file");
|
||||
} else {
|
||||
die("Need two arguments");
|
||||
die("Usage: %s [-t] [INPUT OUTPUT]", progname);
|
||||
}
|
||||
|
||||
// xz options
|
||||
|
Loading…
Reference in New Issue
Block a user