summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/main.c b/main.c
index aea4e18..9ca4f90 100644
--- a/main.c
+++ b/main.c
@@ -15,7 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
- Return values: 0 for a normal exit, 1 for environmental problems
+ Exit status: 0 for a normal exit, 1 for environmental problems
(file not found, invalid flags, I/O errors, etc), 2 to indicate a
corrupt or invalid input file, 3 for an internal consistency error
(eg, bug) which caused clzip to panic.
@@ -52,7 +52,7 @@
#endif
#include "carg_parser.h"
-#include "clzip.h"
+#include "lzip.h"
#include "decoder.h"
#include "encoder.h"
@@ -127,6 +127,10 @@ static void show_help( void )
"scale optimal for all files. If your files are large, very repetitive,\n"
"etc, you may need to use the --match-length and --dictionary-size\n"
"options directly to achieve optimal performance.\n"
+ "\nExit status: 0 for a normal exit, 1 for environmental problems (file\n"
+ "not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or\n"
+ "invalid input file, 3 for an internal consistency error (eg, bug) which\n"
+ "caused clzip to panic.\n"
"\nReport bugs to lzip-bug@nongnu.org\n"
"Clzip home page: http://www.nongnu.org/lzip/clzip.html\n" );
}
@@ -155,8 +159,9 @@ void show_header( const File_header header )
for( i = 0; i < 8 && ( num > 9999 || ( exact && num >= factor ) ); ++i )
{ num /= factor; if( num % factor != 0 ) exact = false;
p = prefix[i]; np = ""; }
- fprintf( stderr, "version %d, dictionary size %s%4u %sB. ",
- Fh_version( header ), np, num, p );
+ if( verbosity >= 4 )
+ fprintf( stderr, "version %d, ", Fh_version( header ) );
+ fprintf( stderr, "dictionary size %s%4u %sB. ", np, num, p );
}
@@ -549,7 +554,7 @@ static int decompress( const int infd, struct Pretty_print * const pp,
retval = 2; break; }
if( verbosity >= 2 || ( verbosity == 1 && first_member ) )
- { Pp_show_msg( pp, 0 ); if( verbosity >= 2 ) show_header( header ); }
+ { Pp_show_msg( pp, 0 ); if( verbosity >= 3 ) show_header( header ); }
if( !LZd_init( &decoder, header, &rdec, outfd ) )
{
@@ -573,13 +578,11 @@ static int decompress( const int infd, struct Pretty_print * const pp,
retval = 2; break;
}
if( verbosity >= 2 )
- { if( testing ) fprintf( stderr, "ok\n" );
- else fprintf( stderr, "done\n" ); Pp_reset( pp ); }
+ { fprintf( stderr, testing ? "ok\n" : "done\n" ); Pp_reset( pp ); }
}
Rd_free( &rdec );
if( verbosity == 1 && retval == 0 )
- { if( testing ) fprintf( stderr, "ok\n" );
- else fprintf( stderr, "done\n" ); }
+ fprintf( stderr, testing ? "ok\n" : "done\n" );
return retval;
}
@@ -702,6 +705,7 @@ int main( const int argc, const char * const argv[] )
{ 'h', "help", ap_no },
{ 'k', "keep", ap_no },
{ 'm', "match-length", ap_yes },
+ { 'n', "threads", ap_yes },
{ 'o', "output", ap_yes },
{ 'q', "quiet", ap_no },
{ 's', "dictionary-size", ap_yes },
@@ -741,6 +745,7 @@ int main( const int argc, const char * const argv[] )
case 'k': keep_input_files = true; break;
case 'm': encoder_options.match_len_limit =
getnum( arg, min_match_len_limit, max_match_len ); break;
+ case 'n': break;
case 'o': default_output_filename = arg; break;
case 'q': verbosity = -1; break;
case 's': encoder_options.dictionary_size = get_dict_size( arg );