Document the --outdir option.

This commit is contained in:
Bastian Kleineidam 2012-04-09 11:56:35 +02:00
parent 822b650c79
commit 9904c8872d
4 changed files with 47 additions and 37 deletions

View File

@ -1,5 +1,8 @@
0.16 "" (released xx.xx.2012) 0.16 "" (released xx.xx.2012)
* Document the --outdir option for the extract command.
Closes: SF Bug #3363964
0.15 "Contraband" (released 8.4.2012) 0.15 "Contraband" (released 8.4.2012)
* Print help when unknown options are given. * Print help when unknown options are given.

View File

@ -1,5 +1,5 @@
.\" -*- nroff -*- .\" -*- nroff -*-
.\" Copyright (C) 2010-2011 Bastian Kleineidam .\" Copyright (C) 2010-2012 Bastian Kleineidam
.\" .\"
.\" This program is free software: you can redistribute it and/or modify .\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by .\" it under the terms of the GNU General Public License as published by
@ -15,8 +15,9 @@
.SH NAME .SH NAME
patool - portable command line archive file manager patool - portable command line archive file manager
.SH SYNOPSIS .SH SYNOPSIS
\fBpatool\fP (\fBextract\fP|\fBlist\fP|\fBtest\fP) [\fI\-\-verbose\fP] <\fIarchive-file\fP>... \fBpatool\fP (\fBlist\fP|\fBtest\fP) [\fB\-\-verbose\fP] <\fIarchive-file\fP>...
\fBpatool\fP \fBcreate\fP [\fI\-\-verbose\fP] <\fIarchive-file\fP> [\fIfiles\fP...] \fBpatool\fP \fBextract\fP [\fB\-\-verbose\fP] [\fB\-\-outdir=\fP\fIDIRNAME\fP] <\fIarchive-file\fP>...
\fBpatool\fP \fBcreate\fP [\fB\-\-verbose\fP] <\fIarchive-file\fP> [\fIfiles\fP...]
\fBpatool\fP \fBdiff\fP <\fIarchive1\fP> <\fIarchive2\fP> \fBpatool\fP \fBdiff\fP <\fIarchive1\fP> <\fIarchive2\fP>
\fBpatool\fP \fBrepack\fP <\fIarchive1\fP> <\fIarchive2\fP> \fBpatool\fP \fBrepack\fP <\fIarchive1\fP> <\fIarchive2\fP>
\fBpatool\fP \fBformats\fP \fBpatool\fP \fBformats\fP
@ -102,4 +103,4 @@ For example:
.SH AUTHOR .SH AUTHOR
Bastian Kleineidam <calvin@users.sourceforge.net> Bastian Kleineidam <calvin@users.sourceforge.net>
.SH COPYRIGHT .SH COPYRIGHT
Copyright \(co 2010-2011 Bastian Kleineidam Copyright \(co 2010-2012 Bastian Kleineidam

View File

@ -6,29 +6,31 @@ NAME
patool - portable command line archive file manager patool - portable command line archive file manager
SYNOPSIS SYNOPSIS
patool (extract|list|test) [--verbose] <archive-file>... patool (list|test) [--verbose] <archive-file>...
patool extract [--verbose] [--outdir=DIRNAME] <archive-
file>...
patool create [--verbose] <archive-file> [files...] patool create [--verbose] <archive-file> [files...]
patool diff <archive1> <archive2> patool diff <archive1> <archive2>
patool repack <archive1> <archive2> patool repack <archive1> <archive2>
patool formats patool formats
DESCRIPTION DESCRIPTION
Various archive types can be created, extracted, tested and Various archive types can be created, extracted, tested and
listed by patool. The advantage of patool is its simplicity in listed by patool. The advantage of patool is its simplicity in
handling archive files without having to remember a myriad of handling archive files without having to remember a myriad of
programs and options. programs and options.
The archive format is determined by the file(1) program and as The archive format is determined by the file(1) program and as
a fallback by the archive file extension. a fallback by the archive file extension.
patool supports 7z (.7z), ACE (.ace), ALZIP (.alz), AR (.a), patool supports 7z (.7z), ACE (.ace), ALZIP (.alz), AR (.a),
ARC (.arc), ARJ (.arj), BZIP2 (.bz2), CAB (.cab), compress ARC (.arc), ARJ (.arj), BZIP2 (.bz2), CAB (.cab), compress
(.Z), CPIO (.cpio), DEB (.deb), GZIP (.gz), LRZIP (.lrz), LZH (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), GZIP (.gz), LRZIP
(.lha, .lzh), LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.lrz), LZH (.lha, .lzh), LZIP (.lz), LZMA (.lzma), LZOP
(.rpm), RAR (.rar), RZIP (.rz), TAR (.tar), XZ (.xz), ZIP (.lzo), RPM (.rpm), RAR (.rar), RZIP (.rz), TAR (.tar), XZ
(.zip, .jar) and ZOO (.zoo) formats. It relies on helper (.xz), ZIP (.zip, .jar) and ZOO (.zoo) formats. It relies on
applications to handle those archive formats (for example bzip2 helper applications to handle those archive formats (for exam
for BZIP2 archives). ple bzip2 for BZIP2 archives).
EXAMPLES EXAMPLES
patool extract archive.zip otherarchive.rar patool extract archive.zip otherarchive.rar
@ -42,48 +44,48 @@ COMMANDS
Several commands and options are available. Several commands and options are available.
extract extract
Extract files from an archive. The original archive will never Extract files from an archive. The original archive will never
be removed and is left as it is. be removed and is left as it is.
This is the default command if no command was given. This is the default command if no command was given.
Files are always extracted to a unique temporary directory in Files are always extracted to a unique temporary directory in
the current working directory. If the archive contains exactly the current working directory. If the archive contains exactly
one file or directory, the archive contents are moved to the one file or directory, the archive contents are moved to the
current working directory and the temporary directory will be current working directory and the temporary directory will be
removed. removed.
This prevents cluttering the current working directory with a This prevents cluttering the current working directory with a
lot of files from the extracted archive. lot of files from the extracted archive.
All extracted files are ensured that they are readable by the All extracted files are ensured that they are readable by the
current user. current user.
-v, --verbose -v, --verbose
Be verbose when extracting (if the helper application Be verbose when extracting (if the helper application
supports it). supports it).
list list
List files in an archive. List files in an archive.
-v, --verbose -v, --verbose
Verbose archive listing (if the helper application sup Verbose archive listing (if the helper application sup
ports it). ports it).
create create
Create an archive from given files. At least on of the given Create an archive from given files. At least on of the given
files to add to the archive has to exist (non-existing files files to add to the archive has to exist (non-existing files
are ignored). The format of the archive to create is deter are ignored). The format of the archive to create is deter
mined by the archive file extension. mined by the archive file extension.
-v, --verbose -v, --verbose
Verbose operation (if the helper application supports Verbose operation (if the helper application supports
it). it).
test test
Test files in an archive. If the helper application does not Test files in an archive. If the helper application does not
support testing, the archive contents are listed instead. support testing, the archive contents are listed instead.
-v, --verbose -v, --verbose
Verbose archive testing (if the helper application sup Verbose archive testing (if the helper application sup
ports it). ports it).
diff diff
@ -91,15 +93,15 @@ COMMANDS
The diff options used are -urN. The diff options used are -urN.
repack repack
Repackage archive to a different format. The target archive Repackage archive to a different format. The target archive
format is determined by the file extension. format is determined by the file extension.
formats formats
Show all supported archive formats (ie. which helper applica Show all supported archive formats (ie. which helper applica
tions are available). tions are available).
HELP OPTION HELP OPTION
Specifying the help option displays help for patool itself, or Specifying the help option displays help for patool itself, or
a command. a command.
For example: For example:
patool --help - display help for patool patool --help - display help for patool
@ -109,7 +111,7 @@ AUTHOR
Bastian Kleineidam <calvin@users.sourceforge.net> Bastian Kleineidam <calvin@users.sourceforge.net>
COPYRIGHT COPYRIGHT
Copyright © 2010 Bastian Kleineidam Copyright © 2010-2012 Bastian Kleineidam

6
patool
View File

@ -46,7 +46,11 @@ def handle_multi_archive(archives, cmd, **kwargs):
return res return res
@baker.command(default=True, shortopts=shortopts, params=params) extract_params = {
"outdir": "Extract to given directory.",
}
extract_params.update(params)
@baker.command(default=True, shortopts=shortopts, params=extract_params)
def extract (archive, *archives, **kwargs): def extract (archive, *archives, **kwargs):
"""Extract files from archive(s).""" """Extract files from archive(s)."""
return handle_multi_archive((archive,)+archives, 'extract', **kwargs) return handle_multi_archive((archive,)+archives, 'extract', **kwargs)