hrx

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package hrx provides the primary functionality of the go-coreutils hrx command.

Index

Constants

View Source
const (
	OpWrote    = "wrote"
	OpListing  = "listing"
	OpArchived = "archived"
)

Variables

View Source
var (
	ErrNotRegular   = errors.New("not a regular file")
	ErrNotPlainText = errors.New("not a plain text file")
	ErrPathRequired = errors.New("at least one path is required")
	ErrFileNotFound = errors.New("file not found")
)
View Source
var (
	// Notifier is the user notice output handler
	Notifier notify.Notifier
)

Functions

func Create

func Create(opt *Options, dst string, pathnames ...string) (a hrx.Archive, err error)

Create produces an archive with the given `pathnames`, according to the Options given and writes the archive to the `dst` path

func Extract

func Extract(opt *Options, src, dst string, pathnames ...string) (err error)

Extract takes an existing `src` archive and extracts it to the `dst` directory, according to the Options given. If `pathnames` are provided, only those pathnames that exist within the `src` archive are extracted

func List

func List(src string, pathnames ...string) (err error)

List displays a list of pathnames within an existing `src` archive file. If any `pathnames` are given, List will only display those pathnames given that exist within the `src` archive file

Types

type Options

type Options struct {
	// All specifies to include hidden files and directories
	All bool
	// Recurse specifies to traverse directories recursively
	Recurse bool
	// PruneDir specifies to prune the top directory from files added to the
	// Archive
	PruneDir bool
	// Boundary specifies the Archive boundary size to use
	Boundary int
	// TrimPrefix specifies an arbitrary string prefix to trim from files
	// added to the Archive
	TrimPrefix string
	// KeepEmpty specifies to include empty directories when added to the
	// Archive
	KeepEmpty bool
}

Options are the complete configurable options for Create and Extract

Directories

Path Synopsis
cmd
hrx command

Jump to

Keyboard shortcuts

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