:: commit 4c8f280b3881ddc00172558415910fb50a501fb9

Kamila Szewczyk <kspalaiologos@gmail.com> — 2022-09-01 14:12

parents: 045667ec43

rudimentary bz3cat

diff --git a/.gitignore b/.gitignore
index 59c95e6..717b6e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,5 @@ autom4te.cache/
 !/build-aux/git-version-gen
 
 bzip3.pc
+
+bz3cat
diff --git a/Makefile.am b/Makefile.am
index fe9e248..8a3ae27 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,7 +29,9 @@ bzip3_CFLAGS = $(AM_CFLAGS)
 bzip3_LDDADD = libbzip3.la
 bzip3_SOURCES = src/main.c $(libbzip3_la_SOURCES)
 
-dist_man_MANS = bzip3.1
+dist_man_MANS = bzip3.1 bz3cat.1
+
+dist_bin_SCRIPTS = bz3cat
 
 CLEANFILES = $(bin_PROGRAMS)
 
diff --git a/bz3cat.1 b/bz3cat.1
new file mode 100644
index 0000000..63fc859
--- /dev/null
+++ b/bz3cat.1
@@ -0,0 +1 @@
+.so man1/bzip3.1
\ No newline at end of file
diff --git a/bz3cat.in b/bz3cat.in
new file mode 100755
index 0000000..07197f3
--- /dev/null
+++ b/bz3cat.in
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH
+
+exec bzip3 -cd "$@"
diff --git a/bzip3.1 b/bzip3.1
index ada276a..c3492a9 100644
--- a/bzip3.1
+++ b/bzip3.1
@@ -8,6 +8,11 @@ bzip3 \- an efficient statistical file compressor and spiritual successor to bzi
 [
 .I "filenames \&..."
 ]
+.
+.P
+.B bz3cat
+is equivalent to
+.B bzip3 \-dc
 .SH DESCRIPTION
 Compress or decompress a file using run length encoding and Lempel Ziv
 prediction, followed by the Burrows-Wheeler transform and arithmetic coding.
@@ -33,7 +38,8 @@ will compress from standard input to standard output, refusing
 to output binary data to a terminal. The \-e flag (encode) is implied.
 
 .BR bzip3
-\-d decompresses data from standard input to the standard output,
+.B \-d
+decompresses data from standard input to the standard output,
 refusing to read from a terminal.
 
 If two files are specified, the first one is used in place of
diff --git a/configure.ac b/configure.ac
index 9d77c00..67b8f44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,7 +57,6 @@ AM_COND_IF([PASSED_CFLAGS], [
 	])
 ])
 
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([bzip3.pc])
+AC_CONFIG_FILES([Makefile bzip3.pc bz3cat])
 AC_ARG_PROGRAM
 AC_OUTPUT
tab: 248 wrap: offon