txtar

command
Version: v0.0.0-...-9d54fb3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

The txtar command writes or extracts a text-based file archive in the format provided by the golang.org/x/tools/txtar package.

The default behavior is to read a comment from stdin and write the archive file containing the recursive contents of the named files and directories, including hidden files, to stdout. Any non-flag arguments to the command name the files and/or directories to include, with the contents of directories included recursively. An empty argument list is equivalent to ".".

The --extract (or -x) flag instructs txtar to instead read the archive file from stdin and extract all of its files to corresponding locations relative to the current, writing the archive's comment to stdout.

Archive files are by default extracted only to the current directory or its subdirectories. To allow extracting outside the current directory, use the --unsafe flag.

Shell variables in paths are expanded (using os.Expand) if the corresponding variable is set in the process environment. When writing an archive, the variables (before expansion) are preserved in the archived paths.

Example usage:

txtar *.go <README >testdata/example.txt

txtar --extract <playground_example.txt >main.go

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL