1

I have a Perl script that determines what external diff to use depending on the file's content. I would like to use it determine external diff3 also.

Which is the best method to know how my script is being called?

I was planning to catch the last three parameters, and verify if they are all files, to use the diff3 options, but I'm hoping there is a cleaner method.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
lamcro
  • 6,069
  • 18
  • 57
  • 70
  • What version control system? Where are the "files" coming from? What are these other parameters you speak of? – Robert P May 05 '10 at 22:52
  • We use Subversion. That itself is a version control system. http://subversion.tigris.com – lamcro May 06 '10 at 00:26
  • The Subversion system uses Unix's diff and diff3 when comparing file differences by default. When you configure it for some other application, the system sends a couple of parameters: 7 for the diff alternate and 11 for the diff3 alternate. – lamcro May 06 '10 at 00:42
  • For more detail: http://svnbook.red-bean.com/nightly/en/svn.advanced.externaldifftools.html#svn.advanced.externaldifftools.diff – lamcro May 06 '10 at 00:43
  • Copy (or symlink) the script to a different name and use `$0` – sendmoreinfo Jan 17 '13 at 18:49

0 Answers0