Crates.io | warpalib |
lib.rs | warpalib |
version | 0.3.1 |
source | src |
created_at | 2022-08-17 10:22:02.552711 |
updated_at | 2022-12-15 17:23:52.273841 |
description | An unopiniated api for parsing renpy archives |
homepage | https://github.com/mensch272/warpa#readme |
repository | https://github.com/mensch272/warpa |
max_upload_size | |
id | 647353 |
size | 58,256 |
Warpa is a command-line tool used to create and extract from renpy archives (rpa).
The program fully supports v3.0 and v2.0 and reading v3.2.
-m
to enable multi-threaded extraction for a single archive by lazy reading file into memory as needed.cargo install --git https://github.com/mensch272/warpa
This and the following examples are focused on warpa, the commandline tool. For information on warpalib visit the docs or check out the examples.
USAGE:
warpa [OPTIONS] <SUBCOMMAND>
OPTIONS:
-h, --help
Print help information
-k, --key <KEY>
The encryption key used for creating v3 archives (default=0xDEADBEEF)
-o, --override-version
Override with default write version (3) if archive version does not support write
-v, --verbose
Provide additional information (default only shows errors)
-V, --version
Print version information
-w, --write-version <WRITE_VERSION>
The write version of archives
SUBCOMMANDS:
add Add files to existing or new archive
extract Extract files with full paths
help Print this message or the help of the given subcommand(s)
list List contents of archive
remove Delete files from archive
update Update existing archive by reading from filesystem
The key argument can be used to specify the index table encryption key for the archive. The default key is "0xDEADBEEF".
warpa -k BA5E7023 add path/to/archive.rpa file.txt
Add files to an archive either existing (will overwrite the existing file with the same path) or create a new archive with:
warpa add path/to/archive.rpa file1.txt file2.txt
Files can alternatively mapped to different paths than in filesystem with ARCHIVE=REAL pattern. In the below example, the file is stored as archive.txt while being read from filesystem.txt
warpa add path/to/archive.rpa archive.txt=filesystem.txt
Or, alternatively you can add files based on glob patterns. The example below adds all files in images folder into the archive.
warpa add path/to/archive.rpa -p "images/**/*"
Extract contents of a single archive into the archive directory with:
warpa extract path/to/archive.rpa
Or, specify a extraction target explicitly by providing the --out
option. In the example below the contents are extracted into the current working directory.
warpa extract path/to/archive.rpa -o .
Extract multiples archives by providing them consecutively.
warpa extract path/to/archive.rpa path/to/another/archive.rpa
Or, use glob patterns to select specific files in the current working directory (and subdirectories). Here as --out
is not specified, the files will be extracted relative to the archive directory.
warpa extract -a "**/*.rpa"
Or, you can even use unix commands like find
find . -type f -name "*.rpa" | xargs warpa extract
Extract has an optional and experimental --memory
flag which enables multi-threaded read into archives. This allows for the extraction of multiple files from the archive at the same time. This works best with large archives containing many files.
warpa extract path/to/archive.rpa -m
List out all the files from an archive with:
warpa list path/to/archive.rpa
Remove files from an archive by specifying their full paths in archive.
warpa remove path/to/archive.rpa file1.txt file2.txt
Or, remove files that match a glob pattern. The example below removes all files ending with .txt
.
warpa remove path/to/archive.rpa -p *.txt
You can alternatively keep the files matching by passing the --keep
flag. This example keeps only the files ending with .txt
.
warpa remove path/to/archive.rpa -p *.txt -k
You can update an existing archive by reading from the surrounding file system. This example tries to read all files that exist in archive from the filessystem. If the archive contains README.md
then warpa would attempt to read README.md
from the directory of the archive.
warpa update path/to/archive.rpa
The files being updated can be filtered using --files
and --pattern
arguments. The command below only updates file1.txt
and other files that end in .md
.
warpa update path/to/archive.rpa -f file1.txt -p "*.md"
Warpa can be instructed to find files relative to another directory by giving the --relative
argument. The command below will look for README.md
in the current working directory.
warpa update path/to/archive.rpa -f README.md -r .
This tool and library is licensed under MIT License.
This tool is intended for use with files on which the authors allow modification of and/or extraction. Unpermitted use on files where such consent was not given is highly discouraged.