yaa110 / nomino Goto Github PK
View Code? Open in Web Editor NEWBatch rename utility for developers
License: Apache License 2.0
Batch rename utility for developers
License: Apache License 2.0
When I'm trying to install the latest version: 0.4.2, I'm getting this error in Arch Linux:
==> ERROR: One or more files did not pass the validity check!
Describe the bug
According to Rust package guidelines, Rust packages on the AUR should declare makedepends=('cargo')
instead of makedepends=('rust')
. This allows rustup
's installed toolchains to be picked up and makes the makepkg -dsi
workaround unnecessary.
I saw that you maintain the AUR package yourself so I thought I'd report the issue here.
Hey Navid,
let me start by expressing my gratitude for your efforts into this nice project !
A frequent use case of mine is to rename a set of numbered files / directories by padding them with zeroes, and Nomino seems best suited for this.
Unfortunately, it insists in renaming some paths when there's no need to.
Take the following example:
d="$(mktemp -d)"
mkdir -p "$d/{1,5,10} - Whatever"
nomino --dir "$d" --print --test '(\d+)(.*)' '{:2}{}'
rmdir "$d"/* ; rmdir "$d"
which outputs
+---------------+----------------+
| Input | Output |
+---------------+----------------+
| 1 - Whatever | 01 - Whatever |
| 5 - Whatever | 05 - Whatever |
| 10 - Whatever | _10 - Whatever |
+---------------+----------------+
whereas I'd expect to get
+---------------+----------------+
| Input | Output |
+---------------+----------------+
| 1 - Whatever | 01 - Whatever |
| 5 - Whatever | 05 - Whatever |
| 10 - Whatever | 10 - Whatever |
+---------------+----------------+
Could you please consider solving this ?
Cheers, and best wished for this end of year !
Describe the bug
When not having write permissions to files, nomino fails silently
Command
➜ nomino -er "(\d).(.*)" "{}-{}"
Expected
An error message that it could not do what it tried to do. (Running the same command with sudo (obviously) worked)
Command map file (create using -g
option)
{
doesnt matter
}
Expected map file
{
tables print fine as expected
}
Version (nomino -V)
nomino 0.4.3
Environment
Is your feature request related to a problem? Please describe.
([^/]*)/.*
would search one more depth than I expect.
Lines 23 to 24 in 88ca0f6
Describe the solution you'd like
Add a --max-depth
and/or --depth
option to control search depth of subdirectories.
If Cargo.lock
is checked into git
, it eases the creation of packages, for example, in https://github.com/NixOS/nixpkgs. Please consider checking it in.
See https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries
Is your feature request related to a problem? Please describe.
I was impressed by the benchmark results and gave nomino a try. It looks like nomino needs a regex pattern of the full string (file path). Most of the time I will just need to replace sub strings in file names but not those in the directory names. E.g., replace all hyphen with space.
Describe the solution you'd like
I might not be aware of it, but has nomino something similar to rnr's sed like solution? rnr -f -r -l0 "pattern" "replacement"
nomino 1.2.2 on Windows 10 21h2 x64
files in the current dir:
1.txt 2.txt ... 10.txt
nomino -tp "(\d+).txt" "{:2}.txt" (not work)
nomino -tp "([0-9]+).txt" "{:2}.txt" (works)
First, thanks for the work you've put into this project. I find it really handy. ;)
Is your feature request related to a problem? Please describe.
I think your project could benefit from letting the user also recurse into subdirectories
For, instance, one could replace a whole subtree-structure as follows:
➜ nomino -p -r "(.*)/(.*)/(.*)" "{} {}.{}"
Could restore your default structure
Nomino (2020) S1.E1.1080p.mkv
Nomino (2020) S1.E2.1080p.mkv
Nomino (2020) S1.E3.1080p.mkv
Nomino (2020) S1.E4.1080p.mkv
Nomino (2020) S1.E5.1080p.mkv
from, let's say a structure like this:
Nomino (2020)/S1/E1.1080p.mkv
Nomino (2020)/S1/E2.1080p.mkv
Nomino (2020)/S1/E3.1080p.mkv
Nomino (2020)/S1/E4.1080p.mkv
Nomino (2020)/S1/E5.1080p.mkv
Describe the solution you'd like
I would recommend that recursion is disabled by default, however, if a /
is used, it is turned on automatically. Recursion depth should be an option in the cli as well.
Best,
da-h
Is your feature request related to a problem? Please describe.
I loved nomino
pragmatic approach to renaming files.
But I missing:
Describe the solution you'd like
Add some command-line options like:
USAGE:
nomino [FLAGS] [OPTIONS] [[SOURCE] OUTPUT]...
FLAGS:
-e, --extension Preserves the extension of input files in 'sort' and 'regex' options
-h, --help Prints help information
-k, --mkdir Recursively creates all parent directories of '<OUTPUT>' if they are missing
-w, --overwrite Overwrites output files, otherwise, a '_' is prepended to filename
- -p, --print Prints the rename map as table to stdout
+ -p, --print Prints the rename map as table to stdout
+ -l, --log Prints the rename map as table to stderr
-t, --test Runs in test mode without renaming actual files (dry-run)
-V, --version Prints version information
OPTIONS:
--depth <DEPTH> Optional value to overwrite inferred subdirectory depth value in 'regex' mode
-d, --dir <PATH> Sets the working directory
-g, --generate <PATH> Stores a JSON map file in '<PATH>' after renaming files
+ -G, --gen-as [FMT] Change stored file format to <FMT> [possible values: cols, csv, json, markdown, table]
+ -F, --format [FMT] Change printed format to <FMT> [possible values: cols, csv, json, markdown, table]
-m, --map <PATH> Sets the path of map file to be used for renaming files
--max-depth <DEPTH> Optional value to set the maximum of subdirectory depth value in 'regex' mode
-r, --regex <PATTERN> Regex pattern (RE2 syntax) to match by filenames
-s, --sort <ORDER> Sets the order of natural sorting (by name) to rename files using enumerator [possible
values: ASC, DESC]
So command invocations like the bellow will print:
$ ls -l *.md
-rw-r--r-- 1 root root 4707 Jun 18 11:38 CODE_OF_CONDUCT.md
-rw-r--r-- 1 root root 10429 Jun 18 11:38 CONTRIBUTING.md
-rw-r--r-- 1 root root 4955 Jun 18 11:38 README.md
$$ nomino -pt -F cols '(.*)\.(md)' '{2}-{1}+{}'
CODE_OF_CONDUCT.md md-CODE_OF_CONDUCT+CODE_OF_CONDUCT
CONTRIBUTING.md md-CONTRIBUTING+CONTRIBUTING
README.md md-README+README
It would be great to be able to feed nomino a .txt with a list of files which need renaming (full paths, one path per line).
Is your feature request related to a problem? Please describe.
I'm downloading torrents and I want them to keep seeding but at the same time I want to have correctly named files
Describe the solution you'd like
I would like to have a flag like -s
or -h
to create symlinks or to create links similar to what the rename
utility has
I try to rename episode names of a series using a JSON map.
When running nomino
, it returns the following error:
$ nomino -ktmp renamed.json
error: No such file or directory (os error 2)
I cannot debug where the actual issue is. I would like a more verbose error message.
episodes.json
{
"Season 01/Episode 01.mp4": "Season01/Episode 01 - Echoes of Thunder.mp4",
"Season 01/Episode 02.mp4": "Season 01/Episode 02 - What Is Done.mp4",
"…": "…",
"Season 05/Episode 09.mp4": "Season05/Episode 09 - Infantis Sanguine.mp4"
}
╭─[/mnt/Series/The Dragon Prince]
╰──╼ls
renamed.json 'Season 01' 'Season 02' 'Season 03' 'Season 04' 'Season 05'
╭─[/mnt/Series/The Dragon Prince]
╰──╼ls Season\ 01/
'Episode 01.mp4' 'Episode 02.mp4' 'Episode 03.mp4' 'Episode 04.mp4' 'Episode 05.mp4' 'Episode 06.mp4' 'Episode 07.mp4' 'Episode 08.mp4' 'Episode 09.mp4' Subs
OS: Debian 12
nomino: v.1.3.4
You should consider making this a cross-platform tool (which should be fairly easy to accomplish being in go).
Having builds available for Windows and Mac would expand the potential user base a great deal.
Describe the bug
Given the following nested hierarchy:
start_dir
├── a
├── b
├── c
│ ├── cc1
│ └── cc2
└── u
├── uu1
└── uu2
nomino's recursion goes only 1 level deep.
Command
➜ nomino -tpkr ".*/(.*)/(.*)" "start_{}_{}"
This should create start_c_cc1,start_c_cc2,start_u_uu1,start_u_uu2
Instead, nomino stops looking at items located in c
and u
folders.
Version (nomino -V)
nomino 0.3.1
Environment
Linux 5.6.4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.