sortfiles

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package sort is used to sort file changes in a variety of ways Alphabetical order is the default

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByIntVar

func ByIntVar(
	changes file.Changes,
	conf *config.Config,
)

ByIntVar sorts changes by user-specified integer variable.

func BySize

func BySize(changes file.Changes, conf *config.Config)

BySize sorts the file changes in place based on their file size, either in ascending or descending order depending on the `reverseSort` flag.

func ByStringVar

func ByStringVar(
	changes file.Changes,
	conf *config.Config,
)

ByStringVar sorts changes by user-specified string variable (lexicographically).

func ByTime

func ByTime(
	changes file.Changes,
	conf *config.Config,
)

ByTime sorts the changes by the specified file timing attribute (modified time, access time, change time, or birth time).

func ByTimeVar

func ByTimeVar(
	changes file.Changes,
	conf *config.Config,
)

ByTimeVar sorts changes by user-specified time variable.

func Changes

func Changes(
	changes file.Changes,
	conf *config.Config,
)

Changes is used to sort changes according to the configured sort value.

func ForRenamingAndUndo

func ForRenamingAndUndo(changes file.Changes, revert bool)

ForRenamingAndUndo is used to sort files before directories to avoid renaming conflicts. It also ensures that child directories are renamed before their parents and vice versa in undo mode.

func Hierarchically

func Hierarchically(changes file.Changes)

Hierarchically ensures all files in the same directory are sorted before children directories.

func Natural

func Natural(changes file.Changes, reverseSort bool)

Natural sorts the changes according to natural order (meaning numbers are interpreted naturally). However, non-numeric characters are remain sorted in ASCII order.

func Pairs

func Pairs(changes file.Changes, pairOrder []string)

Pairs sorts the given file changes based on a custom pairing order. Files with extensions matching earlier entries in pairOrder are sorted before those matching later entries.

Types

This section is empty.

Jump to

Keyboard shortcuts

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