[PATCH] Allow specifying multiple 2 or 3 way file comparison in command line



Hi,

And first of all, congratulations to meld developpers. I'm certainly not the first one to thanks for this very useful but neither the last.

I was looking at the possibility to allow either multiple file 2 way file comparison OR multiple 3 way file comparison in command line.
For me it was a very useful feature when using meld to compute standard output of a configuration management list of files for example
Looking at your mailing list archive I saw "[PATCH] Allow specifying > 2 files at command line" on the 5th of April but it wasn't giving the possibility for 3.

Anyway, it showed me the handling of args wasn't so difficult even for a "totally non Python developper" like me.
Thanks for that.

So, here's my 1st dirty Python "dev" in meldapp.py (from meld 1.1.4):
832,835c832,833
<     -h, --help      Show this help text and exit
<     -v, --version   Display the version and exit
<     -d, --double   For multiple 2 way file/dir comparison (require a %2 num of files as arg)
<     -t, --triple      For multiple 3 way file/dir comparison (require a %3 num of files as arg)
---
>     -h, --help                  Show this help text and exit
>     -v, --version               Display the version and exit
872,891c870
<     if "-d" in args or "--double" in args:
<       if (len(args)-1) % 2 == 0:
<          i = 1
<          while i < len(args):
<               app.append_diff ([args[i], args[i+1]])
<               i = i + 2
<       else:
<          app.usage( _("Wrong number of arguments (Got %i)") % (len(args)-1))
<
<     elif "-t" in args or "--triple" in args:
<       if (len(args)-1) % 3 == 0:
<          i = 1
<          while i < len(args):
<               app.append_diff([args[i], args[i+1], args[i+2]])
<               i = i + 3
<       else:
<          app.usage( _("Wrong number of arguments (Got %i)") % (len(args)-1))
<
<
<     elif len(args) == 0:
---
>     if len(args) == 0:

Regards.

Alexandre



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]