rm

package
v0.0.0-...-d66ac79 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Remove

func Remove(path string) error

Remove - remove the directory.

@param {string} path - the path to the directory.
@return {error} - error.

func RemoveAll

func RemoveAll(path string) error

RemoveAll - remove the directory and all of its contents.

@param {string} path - the path to the directory.
@return {error} - error.

func RemoveDirectory

func RemoveDirectory(path string) error

RemoveDirectory - remove the directory.

@param {string} path - the path to the directory.
@return {error} - error.

func RemoveMultiple

func RemoveMultiple(paths []string) error

RemoveMultiple - remove multiple directories and all of their contents.

@param {[]string} paths - the paths to the directories.
@return {error} - error.

Types

type Directories

type Directories []Directory

Directories is a slice of Directory

type Directory

type Directory struct {
	Name string
	Path string
	Info fs.FileInfo
}

Directory is a struct that contains all the information for a directory

type Flags

type Flags struct {
	H  bool `flag:"help" short:"h" description:"display this help and exit"`                            // rm -h
	F  bool `flag:"force" short:"f" description:"ignore nonexistent files and arguments, never prompt"` // rm -f
	Ii bool `flag:"interactive" short:"i" description:"prompt before every removal"`                    // rm -i
	II bool ``                                                                                          // rm -I
	/* 199-byte string literal not displayed */
	Rf      bool    `flag:"recursive" short:"rf" description:"remove directories and fi"`                        // rm -rf
	Rr      bool    `flag:"recursive" short:"r" description:"remove directories and their contents recursively"` // rm -r
	RR      bool    `flag:"recursive" short:"R" description:"remove directories and their contents recursively"` // rm -R
	D       bool    `flag:"dir" short:"d" description:"remove empty directories"`                                // rm -d
	V       bool    `flag:"verbose" short:"v" description:"explain what is being done"`                          // rm -v
	Version float32 `flag:"version" description:"output version information and exit"`                           // rm --version
}

Flags is a struct that contains all the flags for the rm command

type Rm

type Rm struct {
	Flags // Flags for the rm command

	Stdin  io.Reader
	Stdout io.Writer
	Color  color.Color

	Directory string // Working directory
}

RM is a struct that contains all the information for the rm command

Jump to

Keyboard shortcuts

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