txtar

command
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 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.

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

Jump to

Keyboard shortcuts

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