Author Topic: Calling vsdiff from command line - not finding vs  (Read 2030 times)

rosiedean

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Calling vsdiff from command line - not finding vs
« on: April 19, 2023, 01:25:08 PM »
I was hoping to be able to call up a file difference from a command line - but I cannot get it to work.  We have a customized slick edit version - so there is no vs.exe - I can call up our customized slickedit but it seems to ignore the passed files - i.e. does not do a diff. 
My best guess was that I should call our customized slickedit (say custSlick.exe) as follows
custSlick #diff <file1> <file2>

This calls up my slickedit - but it seems to ignore the files, it does however open the diff prompt - which encourages me with the idea that this should be possible.

If I issue a vsdiff command - and the vsdiff is present - then it complains about not finding vs (but of course because it should be looking for custSlick).  Any suggestions would be appreciated - I apologize if I did not find the answer in the FAQs.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7041
  • Hero Points: 534
Re: Calling vsdiff from command line - not finding vs
« Reply #1 on: April 19, 2023, 05:17:30 PM »
This should do the trick:

Code: [Select]
vs -r diff <file1> <file2>

rosiedean

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Re: Calling vsdiff from command line - not finding vs
« Reply #2 on: April 19, 2023, 08:14:33 PM »
Thank you.  I tried it several times (didn't seem to work) and now it works.  I will take that as working.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7041
  • Hero Points: 534
Re: Calling vsdiff from command line - not finding vs
« Reply #3 on: April 19, 2023, 08:25:23 PM »
You might need the +new switch if SlickEdit is already running.

rosiedean

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Re: Calling vsdiff from command line - not finding vs
« Reply #4 on: April 20, 2023, 02:43:00 PM »
Actually - I may have spoken too soon.  It looks like d3edit has a problem finding the files.  The first few times I call the command - d3edit complains that it cannot find the second file.  I tried putting in the fill filepath - but then there were spaces - which it didn't like - so I put the fill filename and path in single quotes.

d3edit will open a diff - but it seems that it needs to get at least one of the files cached somewhere because it complains about not finding one of the files the first few times.

(All I did was created two files test.txt and test1.txt in the local directory using notepad.  Each file has 3 lines.  I tried this whole thing again - and this time it worked the first time.)

I would blame me, but that is the wife's job.

Actually - I just went back and tried again.  This time I opened our slickedit the way we normally do - it is called programmatically to open a file - i.e. the program calls a command line with the file to open.  I closed that instance.  I tried at the command line to call the diff command as specified above - and our slickedit complains that it cannot find the file.  Strange - it is caching the state the slickedit is opening in.
« Last Edit: April 20, 2023, 02:46:53 PM by rosiedean »

rosiedean

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Re: Calling vsdiff from command line - not finding vs
« Reply #5 on: April 20, 2023, 02:52:30 PM »
Here you go - here is the pattern.

If I open our slickedit with the '-r diff <filename1> <filename2> ' - it complains that it cannot find one of the files and opens slickedit.

As soon as I open one of the files - i.e. filename1 (slickedit filename1) and then if I call slickedit with the '-r diff...' it opens up the diff window with the files loaded.  I think it expects to have at least one of the files cached.
« Last Edit: April 20, 2023, 03:22:31 PM by rosiedean »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7041
  • Hero Points: 534
Re: Calling vsdiff from command line - not finding vs
« Reply #6 on: April 20, 2023, 05:31:24 PM »
I can't reproduce this. I tested 27.0.1 and 26.0.3 since I don't know what version you are running. I did see some weirdness on macOS but not the problem you are seeing.

rosiedean

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Re: Calling vsdiff from command line - not finding vs
« Reply #7 on: April 20, 2023, 09:19:44 PM »
Looks like we are slickedit 2014 :)

From our copy:

Welcome to SlickEdit 2014

SlickEdit Inc.
3000 Aerial Center Parkway Suite 160
Morrisville, NC 27560  USA

1.919.473.0070
1.800.934.EDIT (USA)
1.919.473.0080 fax
       

www.slickedit.com

Information in this documentation is subject to change without notice and does not represent a commitment on the part of SlickEdit Inc. The software described in this documentation is protected by U.S. and international copyright laws and by other applicable laws, and may be used or copied only in accordance with the terms of the license or nondisclosure agreement that accompanies the software. It is against the law to copy the software on any medium except as specifically allowed in the license or nondisclosure agreement. No part of this documentation may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or information storage and retrieval systems, for any purpose other than the licensee's personal use, without the express written permission of SlickEdit Inc.

Copyright 1988-2014 SlickEdit Inc.

SlickEdit, Visual SlickEdit, Clipboard Inheritance, DIFFzilla, SmartPaste, Context Tagging, Slick-C, and Code Quick | Think Slick are registered trademarks of SlickEdit Inc. All other products or company names are used for identification purposes only and may be trademarks of their respective owners. Protected by U.S. Patent 5,710,926.

SE-1301-061108

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7041
  • Hero Points: 534
Re: Calling vsdiff from command line - not finding vs
« Reply #8 on: April 20, 2023, 10:40:02 PM »
This seems to work for SlickEdit 2014 (v19)

Code: [Select]
vs -r diff -modal <filename1> <filename2>

This works too. It exits SlickEdit after running the diff.
Code: [Select]
vs -p diff -modal <filename1> <filename2>

Code: [Select]
vs -mdihide -p diff -modal <filename1> <filename2>

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2919
  • Hero Points: 153
Re: Calling vsdiff from command line - not finding vs
« Reply #9 on: April 24, 2023, 03:07:29 PM »
Looks like we are slickedit 2014 :)

From our copy:

Welcome to SlickEdit 2014

SlickEdit Inc.
3000 Aerial Center Parkway Suite 160
Morrisville, NC 27560  USA

1.919.473.0070
1.800.934.EDIT (USA)
1.919.473.0080 fax
       

www.slickedit.com

Information in this documentation is subject to change without notice and does not represent a commitment on the part of SlickEdit Inc. The software described in this documentation is protected by U.S. and international copyright laws and by other applicable laws, and may be used or copied only in accordance with the terms of the license or nondisclosure agreement that accompanies the software. It is against the law to copy the software on any medium except as specifically allowed in the license or nondisclosure agreement. No part of this documentation may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or information storage and retrieval systems, for any purpose other than the licensee's personal use, without the express written permission of SlickEdit Inc.

Copyright 1988-2014 SlickEdit Inc.

SlickEdit, Visual SlickEdit, Clipboard Inheritance, DIFFzilla, SmartPaste, Context Tagging, Slick-C, and Code Quick | Think Slick are registered trademarks of SlickEdit Inc. All other products or company names are used for identification purposes only and may be trademarks of their respective owners. Protected by U.S. Patent 5,710,926.

SE-1301-061108

You're using SlickEdit 2014 and D3Edit?

rosiedean

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Re: Calling vsdiff from command line - not finding vs
« Reply #10 on: April 28, 2023, 12:28:47 PM »
Yes.

Thank you for all the suggestions.  I suspect that it must be another user setting that is getting in the way of vs finding the files - it always complains about not finding the first file.  I am issuing the command with the expectation that it would find the file in the local directory.  I have tried providing the path - I will look more at providing the full path.

None of the commands work if the file is not cached.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2919
  • Hero Points: 153
Re: Calling vsdiff from command line - not finding vs
« Reply #11 on: April 28, 2023, 12:33:47 PM »
Is there a vsdiff in the D3Edit\win directory as well?

rosiedean

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Re: Calling vsdiff from command line - not finding vs
« Reply #12 on: April 28, 2023, 06:01:53 PM »
Yes.  As I mentioned - I can get the diffzilla to come up - if it has one of the files opened before I call the command line version.

rosiedean

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Re: Calling vsdiff from command line - not finding vs
« Reply #13 on: April 28, 2023, 06:05:31 PM »
Running another test - it may simply be the manner in which I am delivering the file and path to the tool.

I cannot rely on the local path being "findable" for the diff tool.  Perhaps if I am properly specifying the full filepath - then it looks good.

Thanks.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2919
  • Hero Points: 153
Re: Calling vsdiff from command line - not finding vs
« Reply #14 on: April 28, 2023, 07:22:52 PM »
vsdiff will not do any path searching for the files to compare.

If you specify a good first filename, you can specify only a path for the second filename, I'd the filenames match.