It could be usefull with a switch %Y (like the %X switch) that would make the following instances of %S and %R be applied to ONLY truely selected files - hence returning an empty string if no files are selected.
The help for such a switch could look like this:
That should make a command like totalcmd.exe /S=C %Z %T%S1 %Y%T%R1 %y%P%S2 work like cm_CompareFilesByContent%Y Parses the empty string for the following parameters after this parameter, if no files are actively selected:
%S, %s, %R, %r
%y Parses again the name of the file under the cursor, if no files are selected.
This switch could even be expanded to also work for %L, %l, %F, %f, %D, %d, %WL, %WF, %UL and %UF parsing the empty string instead of the name of the temporary list file, when no files are selected
That would make a command like totalcmd.exe /S=S %Z%X "%P" "%T" /O=%Y%L work as cm_FileSync also when no files are selected.