Skip to main content

TAR_HELP

Constant TAR_HELP 

Source
const TAR_HELP: &str = r#"
Pack files and dirs into a TAR container with optional compression

The request file:
  source/data.tar.zst 'tar
   | [[entry]]
   | path = "res/bin/*"
   | name = "bin/*"
   |
   | [[entry]]
   | path = "README.md"
   | name = "docs/README.md"
   |
   | # Optional compression
   | [zstd]
   | level = 19

Packs entries into a TAR, compresses it with ZSTD.

The syntax is a TOML file, the tables are:

[[entry]] — Array of entries to pack.
path — Path or glob pattern, relative to the workspace root. Required.
name — Optional name of the file on the TAR container. Optional.

Each entry can be a file, directory or glob selection. Only file and directory 
entries are supported by this tool, other tar archive entries are not supported.

If 'path' matches a directory all contained files and sub directories are packed. 

Matching is case insensitive in all platforms. See 'glob tool for glob syntax.

If 'name' is not set it is path relative to workspace root. 

If 'name' is set it must not contain "/..".

If 'name' ends with "/*" the selected files and dirs are named in this TAR dir.

All 'name' paths are relative to the TAR root, "/foo" is packed as "foo".

[filter] — Optional lossless transform to apply to the TAR
bcj — Branch/Call/Jump filter that optimizes compression of binary code files.
    Values: "x86", "arm", "arm64", "arm-thumb", "ppc", "sparc", "ia64", "riscv"
    Note that decompressor must revert the filter.

The decompressor must undo these changes before reading the TAR. The 'sfx supports decoding BCJ. 

[zstd] — Optional ZStandard compression
level — Compression level, -131072..=22, 0 means no compression, default is 19.

Compress the TAR, after [filter] is applied, using ZStandard. The "contentsize" field of zstd header
is correctly set, so this is fully compatible with 'sfx that uses this field to report response stream length.

[gzip] — Optional GZip compression
level — Compression level, 0..=9, 0 means no compression, default is 8.

"#;