Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Base errors ErrInvalidArgument = errors.New("prune requires an argument (e.g., orphans or duration like '30d')") // Orphans-related errors ErrOrphansCombination = errors.New("orphans argument cannot be combined with other arguments") // Duration-related errors ErrInvalidDuration = errors.New("invalid duration format") ErrInvalidDurationNum = errors.New("duration must be a positive number") ErrInvalidDurationUnit = errors.New("unsupported duration unit") )
Functions ¶
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
func (*CLI) Prune ¶ added in v1.6.0
Prune handles the pruning of trash contents It processes multiple subcommands for cleaning up the trash
type MetaOption ¶ added in v1.3.0
type Option ¶
type Option struct {
Restore bool `short:"b" long:"restore" description:"Restore deleted file"`
Config string `long:"config" description:"Path to config file" default:""`
Meta MetaOption `group:"Meta Options"`
Rm RmOption `group:"Compatible (rm) Options"`
}
type OrphanedFile ¶ added in v1.6.0
type OrphanedFile struct {
Path string
DeletedAt time.Time
OriginalPath string
TrashInfoPath string
TrashInfoName string
}
OrphanedFile represents an orphaned metadata file with additional details
func (OrphanedFile) GetDeletedAt ¶ added in v1.6.0
func (o OrphanedFile) GetDeletedAt() time.Time
func (OrphanedFile) GetName ¶ added in v1.6.0
func (o OrphanedFile) GetName() string
type PruneArgs ¶ added in v1.6.0
type PruneArgs []string
func (*PruneArgs) UnmarshalFlag ¶ added in v1.6.0
type RmOption ¶
type RmOption struct {
Interactive bool `short:"i" description:"(dummy) prompt before every removal"`
Recursive bool `short:"r" long:"recursive" description:"(dummy) remove directories and their contents recursively"`
Recursive2 bool `short:"R" description:"(dummy) same as -r"`
Force bool `short:"f" long:"force" description:"(dummy) ignore nonexistent files, never prompt"`
Directory bool `short:"d" long:"dir" description:"(dummy) remove empty directories"`
Verbose bool `short:"v" long:"verbose" description:"(dummy) explain what is being done"`
}
RmOption provides compatibility with rm command options https://man7.org/linux/man-pages/man1/rm.1.html
Click to show internal directories.
Click to hide internal directories.