A utility for bulk file management
The project is still in the early stages of development, at the moment it's only possible to install using go install
go install github.com/sftsrv/nameto@latestYou can use the --help flag to view usage information:
nameto --helpnameto can be used in a few different ways:
nameto -f `.*\.go` -t 'new/path/$'
# commit changes
nameto -f `.*\.go` -t 'new/path/$' --commit --editnameto -f `.*\.go` -t 'new/path/$'
# commit changes
nameto -f `.*\.go` -t 'new/path/$' --commit# escaping of regex special chars will depend on your shell
nameto -f `.*\.go` -t 'new/path/$' --from-file path/to/changeset
# commit changes
nameto -f `.*\.go` -t 'new/path/$' --from-file path/to/changset --commitA changeset looks like so:
# Commented-out Lines Start with a Hash
R old/path/rename -> new/path/for/rename
C old/path/copy -> new/path/for/copy
The structure of the regexp provided should be compatible with Go's implementation, with the following affordances made:
- Named capture groups can be specified as '' instead of '?P'
- Regexes are always matched against a single line - so multiline captures are not meaningful
References in pattern are indicated with a $ in the pattern
- `$` refers to the entire match
- `$0` (entire match), `$1` (first capture group), etc. refer to capture groups in order of capture
- `$<name>` or `$name` refer to named capture groups
- Regex based file matching
- Copy a file
- Rename a file
- Automatically create directories
- Preview files to be moved/copied
- Get list of files to work with from existing file
- Support files with spaces (Will implement this if it ever becomes something I care about)