josephburnett / jd

JSON diff and patch
MIT License
826 stars 38 forks source link

filenames not accepted with `-p` #68

Closed mark-pictor-csec closed 4 months ago

mark-pictor-csec commented 6 months ago

With v1.7.1:

jd -p 9999 a.json b.json doesn't give me an error, but when I access the ui it looks like I'm expected to paste files in.

My input files are ~80MB. Not sure how well osx would handle that :)

It'd be nice if the files could be passed to wasm, or at least have an upload button rather than requiring copy and paste.

josephburnett commented 6 months ago

@mark-pictor-csec if you have an 80MB file, why not just use the commandline? Is there a reason you want to use the UI for that? Just want to understand your usecase better.

mark-pictor-csec commented 5 months ago

Yeah I can use the commandline. I was curious what the UI offered, so used the files I had at hand.

I do think it would be nice to have the option of skipping the copy and paste, regardless of file size.

josephburnett commented 4 months ago

I do think it would be nice to have the option of skipping the copy and paste, regardless of file size.

@mark-pictor-csec I've tried to make the UI as "not scary" from a security perspective as possible. None of the data that goes in goes over the network. It's all processed in the browser via jd as a library in WASM. So I would hesitate to have the browser ask for access to the filesystem. And I don't want to complicate the UI by dynamically providing files on the commandline. So I'm not going to add this for now.

One thing I could do is give an error when you type jd -p 9999 a.json b.json because it's ignoring those file. It should say something!

josephburnett commented 4 months ago

Also -p is for "patch". -port is the web UI. Which one did you type?

josephburnett commented 4 months ago

I've added this error message: https://github.com/josephburnett/jd/commit/8e742b1d8cf0f0cc3f58b622df4a54d1f4e54c1a

It will be included in the next jd release.

mark-pictor-csec commented 4 months ago

Also -p is for "patch". -port is the web UI. Which one did you type?

Apparently I typo'd that when creating the issue, as it tells me open 9999: no such file or directory if I try -p 😄