rrthomas / mmv

Other
50 stars 7 forks source link

Return of option "-a" / invoking as "mad" possible? #15

Closed fluffig closed 6 months ago

fluffig commented 10 months ago

Glad to see, that this old piece of software has found a new maintainer!

I'm using mmv for years now making excessive use of mad to append single files to one big "masterfile". As I updated a storage System to Debian 12 I realized that this option is not supported anymore.

Is there a reason for that? I read something about lost sourcecode in late '90-s but the former stable builds were dated ~2003 I guess. Is there any chance to get back this option? I didn't find anything similar to that tool. Everything else would make me write a lot more code like for-loops and a bunch of checks.

rrthomas commented 10 months ago

I removed the mad command to simplify the code as it didn't seem useful to me.

I'll have a look to see how hard it would be to restore.

rrthomas commented 10 months ago

It didn't seem to be very hard! I have restored mad. Please could you test it? Although all I basically did was revert the commit that removed the code, I had to perform the editing manually, having reorganized the code since then, so it may be that I got something wrong.

fluffig commented 10 months ago

Thanks for your very fast reaction! I'll test the code a.s.a.p. and give you reply if it works.

Edit: Just testet with a bunch of files. It works correctly when invoked as "mmv -a". But it tries to rename (and fails with collisions) when invoked as "mad", such as if it was invoked as "mmv". I guess there is something missing in the evaluation of the invoked command name.

rrthomas commented 9 months ago

Sorry, I didn't see this update.

rrthomas commented 9 months ago

Actually, it works fine when invoked normally as a program on your PATH. The problem is another bug (which I'll fix, thanks): namely, the name detection only works when the full program path in its invocation is just mad etc. If you invoke it as ./mad it doesn't work (and the same for other names).

rrthomas commented 9 months ago

I've pushed a fix for the problem you experienced; please could you try it?