Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

--json argument is not properly handled by lfc #1909

Closed
lhstrh opened this issue Jul 22, 2023 · 6 comments · Fixed by #1988
Closed

--json argument is not properly handled by lfc #1909

lhstrh opened this issue Jul 22, 2023 · 6 comments · Fixed by #1988

Comments

@lhstrh
Copy link
Member

lhstrh commented Jul 22, 2023

Example:

lfc --json="{\"src\":\"/home/marten/lf-lang/lingo/sandbox/src/Main.lf\"}"

=>

lfc: fatal error: Invalid JSON string:
 {src:/home/marten/lf-lang/lingo/sandbox/src/Main.lf}
@lhstrh
Copy link
Member Author

lhstrh commented Jul 22, 2023

The problem here is that in a development setup, lfc goes through Gradle, which strips all the quotes from the JSON string.

When using ./build/install/lf-cli/bin/lfc directly, this does not occur.

@lhstrh
Copy link
Member Author

lhstrh commented Jul 22, 2023

The problem is something like this but I haven't been able to find a solution to it.

@lhstrh
Copy link
Member Author

lhstrh commented Jul 22, 2023

Actually, we might be better off using stdin instead of CLI arguments to accept JSON data...

@tanneberger
Copy link
Member

I am confused about this because normally the json also needs to include a out and properties field.

Should lfc if out is not specified drop the files in the current working directory ?

@lhstrh
Copy link
Member Author

lhstrh commented Jul 23, 2023

I am confused about this because normally the json also needs to include a out and properties field.

Should lfc if out is not specified drop the files in the current working directory ?

This is not about the contents of the json, this is about the json itself not being formatted properly. It turns out that Gradle messes with the quotes in the dev version of lfc...

@axmmisaka
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants