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

Add flag for zero-output/exit code only #12

Open
gabesullice opened this issue May 13, 2020 · 4 comments
Open

Add flag for zero-output/exit code only #12

gabesullice opened this issue May 13, 2020 · 4 comments

Comments

@gabesullice
Copy link

Would you be interested in a PR that adds an -e flag that means "print nothing to standard out"?

My use case is using yajsv in a CI pipeline. In which case I don't really want to see any output, I just want to know "did this exit with 0?"

Thanks for making this available btw! It's very handy regardless!

@neilpa
Copy link
Owner

neilpa commented May 14, 2020

There's already a -q flag which only prints errors so if everything passes you get no output. If you really want zero output you can pipe to /dev/null. I'd like to keep things simple and not add an option for something that is easily done from the shell.

@gabesullice
Copy link
Author

gabesullice commented May 19, 2020

I understand. Glad I asked :)

Thanks again!


I was aware of -q, and this was my reasoning for why a new arg might make sense:

Most *nix command would be about as verbose as yajsv is with the -q option by default; then they would have a -v flag to increase verbosity to the current default. In addition, they often have a flag like -s code for "silent", but since -s is already taken for defining a schema file, I chose -e for "exit code only".

@neilpa
Copy link
Owner

neilpa commented May 19, 2020

Thanks for the feedback. That's a good point about the the defaults maybe being too verbose since it prints every file processed. Now I'm wondering if -q should be the default behavior where it only prints errors and failures. Then you explicitly opt into a verbose mode (unfortunately -v is already taken for printing the version)

I'm going to reopen this and think on it.

@neilpa
Copy link
Owner

neilpa commented Oct 6, 2020

See also #13 (comment) for adding additional output such as the text encoding in a verbose mode.

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

No branches or pull requests

2 participants