2
0
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:
Dave Vasilevsky 2010-10-12 02:19:55 -04:00
parent 86e0a1998c
commit a1cd0e174e
3 changed files with 13 additions and 5 deletions

View File

@ -32,6 +32,9 @@ write: write.o common.o endian.o cpu.o
read: read.o common.o endian.o read: read.o common.o endian.o
$(LD) $@ $^ -llzma $(LD) $@ $^ -llzma
pread: pread.o common.o endian.o
$(LD) $@ $^ -llzma
clean: clean:
rm -f *.o $(PROGS) rm -f *.o $(PROGS)

12
list.c
View File

@ -8,10 +8,14 @@
int main(int argc, char **argv) { int main(int argc, char **argv) {
char *progname = argv[0]; char *progname = argv[0];
if (argc != 2) if (argc == 1) {
die("Usage: %s [-t] file", progname); gInFile = stdin;
if (!(gInFile = fopen(argv[1], "r"))) } else if (argc == 2) {
die("Can't open input file"); if (!(gInFile = fopen(argv[1], "r")))
die("Can't open input file");
} else {
die("Usage: %s [FILE]", progname);
}
decode_index(); decode_index();
lzma_index_iter iter; lzma_index_iter iter;

View File

@ -82,6 +82,7 @@ static void write_file_index_buf(lzma_action action);
#pragma mark FUNCTION DEFINITIONS #pragma mark FUNCTION DEFINITIONS
int main(int argc, char **argv) { int main(int argc, char **argv) {
char *progname = argv[0];
debug("launch"); debug("launch");
int ch; int ch;
@ -111,7 +112,7 @@ int main(int argc, char **argv) {
if (!(gOutFile = fopen(argv[2], "w"))) if (!(gOutFile = fopen(argv[2], "w")))
die("Can't open output file"); die("Can't open output file");
} else { } else {
die("Need two arguments"); die("Usage: %s [-t] [INPUT OUTPUT]", progname);
} }
// xz options // xz options