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

Wrong file generated #66

Open
ftomassetti opened this issue Dec 19, 2019 · 2 comments
Open

Wrong file generated #66

ftomassetti opened this issue Dec 19, 2019 · 2 comments
Assignees
Labels
invalid This doesn't seem right ov-cli refactor Code could be rewritten in a better way

Comments

@ftomassetti
Copy link
Contributor

If I run:

java -jar openvalidation.jar --culture en --language java
--rule "your age HAS to be greater than 22" --schema "{ age: 21 }" --output age_check.js
The file age_check.java is generated, therefore the output directive is not precisely respected, which is confusing to me

@thecodemonkey
Copy link
Contributor

thecodemonkey commented Dec 20, 2019

Yes, Federico, once again you're right. This parameter is not entirely clear.

The parameter --output(-o) actually defines the output directory. However, there is the parameter --single-file (-f) over it you can get all the generated code, which actually consists of 2 files: Implementation(Rule Set) and HUMLFramework in one single file. If the -f switch is set, then you can specify the name of this single file with -o. I know that it is not really cleanly implemented at this point. And we should definitely change it.

https://docs.openvalidation.io/openvalidation-cli#single-file
https://docs.openvalidation.io/openvalidation-cli#output

My suggestion is:

  1. That we use the --output (-o) parameter to enter only the output directory. (it is not allowed to give file names with extension. we can validate it.)
  2. the parameter --single-file (-f) should no longer be a switch(boolean), but a string parameter to specify the output name of the single file. If you do not specify anything, the default name (HUMLValidator.xxx) will be used.

what do you think about this?

@thecodemonkey thecodemonkey added invalid This doesn't seem right ov-cli refactor Code could be rewritten in a better way labels Dec 20, 2019
@ftomassetti
Copy link
Contributor Author

it makes sense to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right ov-cli refactor Code could be rewritten in a better way
Projects
None yet
Development

No branches or pull requests

2 participants