Package: pbzip2
Version: 1.0.4-2
Severity: wishlist
Tags: patch

Please include this patch to next release (after 1.0.5)

- Diplays GNU --long options in usage()
- Add long options: --read and --loadavg as synonyms for
  exixting short options.

-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pbzip2 depends on:
ii  libbz2-1.0                    1.0.5-1    high-quality block-sorting file co
ii  libc6                         2.7-18     GNU C Library: Shared libraries
ii  libgcc1                       1:4.3.3-3  GCC support library
ii  libstdc++6                    4.3.3-3    The GNU Standard C++ Library v3

pbzip2 recommends no packages.

pbzip2 suggests no packages.

-- no debconf information
>From e30f8881877f55706622c125b826f71aa224ed7c Mon Sep 17 00:00:00 2001
From: Jari Aalto <[email protected]>
Date: Thu, 26 Feb 2009 20:43:01 +0200
Subject: [PATCH] pbzip2.cpp: improve usage(). Add long options --loadavg, --read

Signed-off-by: Jari Aalto <[email protected]>
---
 pbzip2.cpp |   42 ++++++++++++++++++++++++++----------------
 1 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/pbzip2.cpp b/pbzip2.cpp
index 0a9648b..c041183 100644
--- a/pbzip2.cpp
+++ b/pbzip2.cpp
@@ -13,6 +13,8 @@
  *
  *  Contributions
  *  -------------
+ *  Jari Aalto <[email protected]> - Add long options to -h output.
+ *                                      Add --loadavg, --read long options.
  *  Bryan Stillwell <[email protected]> - code cleanup, RPM spec, prep work
  *			for inclusion in Fedora Extras
  *  Dru Lemley [http://lemley.net/smp.html] - help with large file support
@@ -1941,31 +1943,31 @@ void usage(char* progname, const char *reason)
 #else
 	fprintf(stderr, "Usage: %s [-1 .. -9] [-b#cdfhkp#qrtVz] <filename> <filename2> <filenameN>\n", progname);
 #endif
-	fprintf(stderr, " -b#      : where # is the file block size in 100k (default 9 = 900k)\n");
-	fprintf(stderr, " -c       : output to standard out (stdout)\n");
-	fprintf(stderr, " -d       : decompress file\n");
-	fprintf(stderr, " -f       : force, overwrite existing output file\n");
-	fprintf(stderr, " -h       : print this help message\n");
-	fprintf(stderr, " -k       : keep input file, don't delete\n");
+	fprintf(stderr, " -1 .. -9        set BWT block size to 100k .. 900k (default 900k)\n\n");
+	fprintf(stderr, " -b#             Block size in 100k steps (default 9 = 900k)\n");
+	fprintf(stderr, " -c,--stdout     Output to standard out (stdout)\n");
+	fprintf(stderr, " -d,--decompress Decompress file\n");
+	fprintf(stderr, " -f,--force      Overwrite existing output file\n");
+	fprintf(stderr, " -h,--help       Print this help message\n");
+	fprintf(stderr, " -k,--keep       Keep input file, don't delete\n");
 #ifndef PBZIP_NO_LOADAVG
-	fprintf(stderr, " -l       : load average determines max number processors to use\n");
+	fprintf(stderr, " -l,--loadavg    Load average determines max number processors to use\n");
 #endif
-	fprintf(stderr, " -p#      : where # is the number of processors (default");
+	fprintf(stderr, " -p#             Number of processors to use (default");
 #if defined(_SC_NPROCESSORS_ONLN) || defined(__APPLE__)
 	fprintf(stderr, ": autodetect [%d])\n", detectCPUs());
 #else
 	fprintf(stderr, " 2)\n");
 #endif
-	fprintf(stderr, " -q       : quiet mode (default)\n");
-	fprintf(stderr, " -r       : read entire input file into RAM and split between processors\n");
-	fprintf(stderr, " -t       : test compressed file integrity\n");
-	fprintf(stderr, " -v       : verbose mode\n");
-	fprintf(stderr, " -V       : display version info for pbzip2 then exit\n");
-	fprintf(stderr, " -z       : compress file (default)\n");
-	fprintf(stderr, " -1 .. -9 : set BWT block size to 100k .. 900k (default 900k)\n\n");
+	fprintf(stderr, " -q,--quiet      Quiet mode (default)\n");
+	fprintf(stderr, " -r,--read       Read entire input file into RAM and split between processors\n");
+	fprintf(stderr, " -t,--test       Test compressed file integrity\n");
+	fprintf(stderr, " -v,--verbose    Verbose mode\n");
+	fprintf(stderr, " -V,--version    Display version info for pbzip2 then exit\n");
+	fprintf(stderr, " -z,--compress   Compress file (default)\n\n");
 	fprintf(stderr, "Example: pbzip2 -b15vk myfile.tar\n");
 	fprintf(stderr, "Example: pbzip2 -p4 -r -5 myfile.tar second*.txt\n");
-	fprintf(stderr, "Example: tar cf myfile.tar.bz2 --use-compress-prog=pbzip2 dir_to_compress/\n");
+	fprintf(stderr, "Example: tar -cf myfile.tar.bz2 --use-compress-prog=pbzip2 dir_to_compress/\n");
 	fprintf(stderr, "Example: pbzip2 -d myfile.tar.bz2\n\n");
 	exit(-1);
 }
@@ -2118,10 +2120,18 @@ int main(int argc, char* argv[])
 				{
 					usage(argv[0], "HELP");
 				}
+				else if (strcmp(argv[i], "--loadavg") == 0)
+				{
+					useLoadAverage = 1;
+				}
 				else if (strcmp(argv[i], "--quiet") == 0)
 				{
 					QuietMode = 1;
 				}
+				else if (strcmp(argv[i], "--read") == 0)
+				{
+					readEntireFile = 1;
+				}
 				else if (strcmp(argv[i], "--stdout") == 0)
 				{
 					OutputStdOut = 1; keep = 1;
-- 
1.6.1.3

Reply via email to