aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/bzcat.c14
-rw-r--r--toys/toylist.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/toys/bzcat.c b/toys/bzcat.c
new file mode 100644
index 00000000..30437bb8
--- /dev/null
+++ b/toys/bzcat.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * bzcat.c - decompress stdin to stdout using bunzip2.
+ */
+
+#include "toys.h"
+
+int bzcat_main(void)
+{
+ char *error = bunzipStream(0, 1);
+
+ if (error) error_exit(error);
+ return 0;
+}
diff --git a/toys/toylist.h b/toys/toylist.h
index 258df47f..2f95232f 100644
--- a/toys/toylist.h
+++ b/toys/toylist.h
@@ -67,6 +67,7 @@ NEWTOY(toybox, NULL, 0)
// The rest of these are alphabetical, for binary search.
+USE_BZCAT(NEWTOY(bzcat, "", TOYFLAG_USR|TOYFLAG_BIN))
USE_CATV(NEWTOY(catv, "vte", TOYFLAG_NOFORK|TOYFLAG_USR|TOYFLAG_BIN))
USE_TOYSH(NEWTOY(cd, NULL, TOYFLAG_NOFORK))
USE_DF(NEWTOY(df, "Pkt*a", TOYFLAG_USR|TOYFLAG_SBIN))