Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Directory textdiff: Error while parsing arguments of client 'textdiff' Source must be a file #217

Open
dayaad opened this issue Feb 16, 2021 · 3 comments

Comments

@dayaad
Copy link

dayaad commented Feb 16, 2021

When using textdiff to compare packages/multiple files I see the following error:

Error while parsing arguments of client 'textdiff'.
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at com.github.gumtreediff.gen.Registry.lambda$defaultFactory$1(Registry.java:127)
	at com.github.gumtreediff.client.Run.startClient(Run.java:79)
	at com.github.gumtreediff.client.Run.main(Run.java:115)
Caused by: com.github.gumtreediff.client.Option$OptionException: Source must be a file: /Users/diyaayaa/Downloads/python-basics-exercises-master/ch06-functions-and-loops
	at com.github.gumtreediff.client.diff.TextDiff.<init>(TextDiff.java:43)
  • I would like to get the diff output in JSON format that's the reason am using textdiff.
@jrfaller jrfaller self-assigned this Feb 16, 2021
@jrfaller
Copy link
Member

Hi!

Currently textdiff accept only two files as arguments (source and destination files).

However it could be nice to have a whole directory diff such as webdiff. I am not sure however what would be the output...

Cheers.

@dayaad
Copy link
Author

dayaad commented Feb 16, 2021

Hi @jrfaller ,

So am assuming that textdiff won't give me the (Deleted/Added files).
I think for file differences maybe for now I can create a small script to go through the files that've been modified. But, I am still thinking of a way to use GumTree to list out what files have been added/deleted and get that list output on terminal or a file.. not through webdiff.

@jrfaller
Copy link
Member

Hi, there is the DirectoryComparator (https://github.com/GumTreeDiff/gumtree/blob/main/core/src/main/java/com/github/gumtreediff/io/DirectoryComparator.java) that does exactly that, but it is not associated to a CLI command 😢

Then we could use this inside the textdiff command, but we have to think about how the output would look like, especially between the multiple diffs (filenames? special syntax to enable post-processing?).

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants