cmd

package
v1.1.2 Latest Latest
Warning

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

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

Documentation

Overview

© Ben Garrett https://github.com/bengarrett/dupers

Index

Constants

View Source
const (
	Debug_   = "debug"
	Delete_  = "delete"
	DelPlus_ = "delete+"
	Exact_   = "exact"
	Fast_    = "fast"
	Help_    = "help"
	Mono_    = "mono"
	Name_    = "name"
	Quiet_   = "quiet"
	Sensen_  = "sensen"
	Yes_     = "yes"
	Version_ = "version"
)

Variables

View Source
var (
	ErrWindowsDir = errors.New("cannot parse the directory path")
	ErrNilFlag    = errors.New("flags cannot be a nil value")
	ErrNilAlias   = errors.New("aliases cannot be a nil value")
)

Functions

func Home

func Home() string

Home returns the user home directory. If that fails it returns the current working directory.

func SearchSummary

func SearchSummary(total int, term string, exact, filename bool) string

SearchSummary formats the results of the search command.

func Self

func Self() (string, error)

Self returns the path to the dupers executable file.

func WindowsChk

func WindowsChk(name string) error

WindowsChk checks the named directory for invalid, escaped quoted paths when using Windows cmd.exe.

Types

type Aliases

type Aliases struct {
	Debug    *bool `usage:"alias for debug"`
	Exact    *bool `usage:"alias for exact"`
	Filename *bool `usage:"alias for filename"`
	Help     *bool `usage:"alias for help"`
	Lookup   *bool `usage:"alias for lookup"`
	Mono     *bool `usage:"alias for mono"`
	Quiet    *bool `usage:"alias for quiet"`
	Yes      *bool `usage:"alias for quiet"`
	Version  *bool `usage:"alias for version"`
}

Aliases are single letter options for commands.

func (*Aliases) Define

func (a *Aliases) Define()

Define optional aliases for the program and commands flags.

func (*Aliases) Usage

func (a *Aliases) Usage(name string) string

Usage of the command aliases.

type Flags

type Flags struct {
	Exact    *bool `usage:"match case"`
	Filename *bool `usage:"search for filenames, and ignore directories"`
	Lookup   *bool `` //nolint:lll
	/* 139-byte string literal not displayed */
	Rm     *bool `usage:"delete the duplicate files found in the\n\t <directory to check>"`
	RmPlus *bool `usage:"delete the duplicate files and remove empty directories\n\t from the <directory to check>"`
	Sensen *bool `` //nolint:lll
	/* 130-byte string literal not displayed */

	Debug   *bool `usage:"debug is a verbose mode to print all the activities\n\t and tasks"`
	Help    *bool `usage:"print help"`
	Mono    *bool `usage:"monochrome mode to remove all color output"`
	Quiet   *bool `usage:"quiet mode hides all but essential feedback"`
	Yes     *bool `usage:"assume yes for any user prompts"`
	Version *bool `usage:"version and information for this program"`
}

Flags provide options for both the commands and the program.

func (*Flags) Aliases

func (f *Flags) Aliases(a *Aliases, c *dupe.Config) dupe.Config

Aliases parses the command aliases and flags, configuring both Flags and dupe.Config.

func (*Flags) Define

func (f *Flags) Define()

Define options for the program and commands.

func (*Flags) Usage

func (f *Flags) Usage(name string) string

Usage of the command flags.

Directories

Path Synopsis
© Ben Garrett https://github.com/bengarrett/dupers
© Ben Garrett https://github.com/bengarrett/dupers
bucket
© Ben Garrett https://github.com/bengarrett/dupers
© Ben Garrett https://github.com/bengarrett/dupers
duplicate
© Ben Garrett https://github.com/bengarrett/dupers
© Ben Garrett https://github.com/bengarrett/dupers
search
© Ben Garrett https://github.com/bengarrett/dupers
© Ben Garrett https://github.com/bengarrett/dupers

Jump to

Keyboard shortcuts

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