cmd

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package cmd provides command-line interface functionality for the application.

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 FuzzSearchSummary added in v1.2.0

func FuzzSearchSummary(f *testing.F)

FuzzSearchSummary fuzz tests the search summary formatting.

func FuzzWindowsChk added in v1.2.0

func FuzzWindowsChk(f *testing.F)

FuzzWindowsChk fuzz tests the Windows directory path validation.

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 nuoted 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
	/* 134-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 enables verbose output showing all program activities"`
	Help    *bool `usage:"print help"`
	Mono    *bool `usage:"monochrome mode to remove all color output"`
	Quiet   *bool `usage:"quiet mode suppresses non-essential output and progress indicators"`
	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
Package task provides task execution and coordination functionality.
Package task provides task execution and coordination functionality.
bucket
Package bucket provides bucket-related command functionality.
Package bucket provides bucket-related command functionality.
duplicate
Package duplicate provides duplicate file detection functionality.
Package duplicate provides duplicate file detection functionality.
search
Package search provides file search functionality.
Package search provides file search functionality.

Jump to

Keyboard shortcuts

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