~ubuntu-branches/ubuntu/saucy/pbzip2/saucy

« back to all changes in this revision

Viewing changes to debian/patches/01-517268-improve-usage-add-long-options.patch

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2010-03-14 13:45:49 UTC
  • mfrom: (7.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100314134549-qj67ae1xwsjfy2sx
* New upstream release
  Closes: 573764
* Patches merged upstream:
  01-517268-improve-usage-add-long-options.patch
  02-517259-add-long-options.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From e30f8881877f55706622c125b826f71aa224ed7c Mon Sep 17 00:00:00 2001
2
 
From: Jari Aalto <jari.aalto@cante.net>
3
 
Date: Thu, 26 Feb 2009 20:43:01 +0200
4
 
Subject: [PATCH] pbzip2.cpp: improve usage(). Add long options --loadavg, --read
5
 
 
6
 
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
7
 
---
8
 
 pbzip2.cpp |   42 ++++++++++++++++++++++++++----------------
9
 
 1 files changed, 26 insertions(+), 16 deletions(-)
10
 
 
11
 
diff --git a/pbzip2.cpp b/pbzip2.cpp
12
 
index 0a9648b..c041183 100644
13
 
--- a/pbzip2.cpp
14
 
+++ b/pbzip2.cpp
15
 
@@ -13,6 +13,8 @@
16
 
  *
17
 
  *  Contributions
18
 
  *  -------------
19
 
+ *  Jari Aalto <jari.aalto@cante.net> - Add long options to -h output.
20
 
+ *                                      Add --loadavg, --read long options.
21
 
  *  Bryan Stillwell <bryan@bokeoa.com> - code cleanup, RPM spec, prep work
22
 
  *                     for inclusion in Fedora Extras
23
 
  *  Dru Lemley [http://lemley.net/smp.html] - help with large file support
24
 
@@ -1941,31 +1943,31 @@ void usage(char* progname, const char *reason)
25
 
 #else
26
 
        fprintf(stderr, "Usage: %s [-1 .. -9] [-b#cdfhkp#qrtVz] <filename> <filename2> <filenameN>\n", progname);
27
 
 #endif
28
 
-       fprintf(stderr, " -b#      : where # is the file block size in 100k (default 9 = 900k)\n");
29
 
-       fprintf(stderr, " -c       : output to standard out (stdout)\n");
30
 
-       fprintf(stderr, " -d       : decompress file\n");
31
 
-       fprintf(stderr, " -f       : force, overwrite existing output file\n");
32
 
-       fprintf(stderr, " -h       : print this help message\n");
33
 
-       fprintf(stderr, " -k       : keep input file, don't delete\n");
34
 
+       fprintf(stderr, " -1 .. -9        set BWT block size to 100k .. 900k (default 900k)\n\n");
35
 
+       fprintf(stderr, " -b#             Block size in 100k steps (default 9 = 900k)\n");
36
 
+       fprintf(stderr, " -c,--stdout     Output to standard out (stdout)\n");
37
 
+       fprintf(stderr, " -d,--decompress Decompress file\n");
38
 
+       fprintf(stderr, " -f,--force      Overwrite existing output file\n");
39
 
+       fprintf(stderr, " -h,--help       Print this help message\n");
40
 
+       fprintf(stderr, " -k,--keep       Keep input file, don't delete\n");
41
 
 #ifndef PBZIP_NO_LOADAVG
42
 
-       fprintf(stderr, " -l       : load average determines max number processors to use\n");
43
 
+       fprintf(stderr, " -l,--loadavg    Load average determines max number processors to use\n");
44
 
 #endif
45
 
-       fprintf(stderr, " -p#      : where # is the number of processors (default");
46
 
+       fprintf(stderr, " -p#             Number of processors to use (default");
47
 
 #if defined(_SC_NPROCESSORS_ONLN) || defined(__APPLE__)
48
 
        fprintf(stderr, ": autodetect [%d])\n", detectCPUs());
49
 
 #else
50
 
        fprintf(stderr, " 2)\n");
51
 
 #endif
52
 
-       fprintf(stderr, " -q       : quiet mode (default)\n");
53
 
-       fprintf(stderr, " -r       : read entire input file into RAM and split between processors\n");
54
 
-       fprintf(stderr, " -t       : test compressed file integrity\n");
55
 
-       fprintf(stderr, " -v       : verbose mode\n");
56
 
-       fprintf(stderr, " -V       : display version info for pbzip2 then exit\n");
57
 
-       fprintf(stderr, " -z       : compress file (default)\n");
58
 
-       fprintf(stderr, " -1 .. -9 : set BWT block size to 100k .. 900k (default 900k)\n\n");
59
 
+       fprintf(stderr, " -q,--quiet      Quiet mode (default)\n");
60
 
+       fprintf(stderr, " -r,--read       Read entire input file into RAM and split between processors\n");
61
 
+       fprintf(stderr, " -t,--test       Test compressed file integrity\n");
62
 
+       fprintf(stderr, " -v,--verbose    Verbose mode\n");
63
 
+       fprintf(stderr, " -V,--version    Display version info for pbzip2 then exit\n");
64
 
+       fprintf(stderr, " -z,--compress   Compress file (default)\n\n");
65
 
        fprintf(stderr, "Example: pbzip2 -b15vk myfile.tar\n");
66
 
        fprintf(stderr, "Example: pbzip2 -p4 -r -5 myfile.tar second*.txt\n");
67
 
-       fprintf(stderr, "Example: tar cf myfile.tar.bz2 --use-compress-prog=pbzip2 dir_to_compress/\n");
68
 
+       fprintf(stderr, "Example: tar -cf myfile.tar.bz2 --use-compress-prog=pbzip2 dir_to_compress/\n");
69
 
        fprintf(stderr, "Example: pbzip2 -d myfile.tar.bz2\n\n");
70
 
        exit(-1);
71
 
 }
72
 
@@ -2118,10 +2120,18 @@ int main(int argc, char* argv[])
73
 
                                {
74
 
                                        usage(argv[0], "HELP");
75
 
                                }
76
 
+                               else if (strcmp(argv[i], "--loadavg") == 0)
77
 
+                               {
78
 
+                                       useLoadAverage = 1;
79
 
+                               }
80
 
                                else if (strcmp(argv[i], "--quiet") == 0)
81
 
                                {
82
 
                                        QuietMode = 1;
83
 
                                }
84
 
+                               else if (strcmp(argv[i], "--read") == 0)
85
 
+                               {
86
 
+                                       readEntireFile = 1;
87
 
+                               }
88
 
                                else if (strcmp(argv[i], "--stdout") == 0)
89
 
                                {
90
 
                                        OutputStdOut = 1; keep = 1;