yaa110 / nomino

Batch rename utility for developers
Apache License 2.0
558 stars 19 forks source link

Unwelcomed `_` when zero-padding filenames #17

Closed ngirard closed 1 year ago

ngirard commented 1 year ago

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 !

yaa110 commented 1 year ago

Thank you for reporting the issue. Fixed in 1.3.0

ngirard commented 1 year ago

v1.3.0 works like a charm, thank you very much, Navid !