Skip to content

Commit

Permalink
Add a new command 'patool version' to show version information
Browse files Browse the repository at this point in the history
  • Loading branch information
wummel committed Nov 9, 2023
1 parent 2d36c60 commit 5af08ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Removed the recompress command.
* Use the new filter option when extracting TAR archives with the tarfile
module in Python >= 3.12 to detect unsafe archive entries.
* Added new command "patool version" to print version information.


1.15.0 (released 28.10.2023)
Expand Down
4 changes: 4 additions & 0 deletions doc/patool.1
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ determined by the file extension of \fIarchive_new\fP.
.PP
Show all supported archive formats (i.e. which helper applications
are available).
.SS version
\fBpatool\fP \version\fP
.PP
Print version information.
.SH HELP OPTION
Specifying the help option displays help for patool itself, or a
command.
Expand Down
5 changes: 5 additions & 0 deletions doc/patool.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ COMMANDS
Show all supported archive formats (i.e. which helper applica‐
tions are available).

version
patool sion

Print version information.

HELP OPTION
Specifying the help option displays help for patool itself, or
a command.
Expand Down
7 changes: 7 additions & 0 deletions patoolib/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ def run_formats (args):
return 0


def run_version(args):
print(App)
return 0


class ArgumentParser(argparse.ArgumentParser):
"""Custom argument parser."""

Expand Down Expand Up @@ -191,6 +196,8 @@ def create_argparser():
parser_search.add_argument('archive', help='the archive file')
# formats
subparsers.add_parser('formats', help="show supported archive formats")
# version
subparsers.add_parser('version', help="print version information")
# optional bash completion
try:
import argcomplete
Expand Down

0 comments on commit 5af08ab

Please sign in to comment.