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

Output message when reading from standard input #44

Open
fredher opened this issue Jun 15, 2020 · 2 comments
Open

Output message when reading from standard input #44

fredher opened this issue Jun 15, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@fredher
Copy link
Collaborator

fredher commented Jun 15, 2020

TChecker silently waits when reading from standard input. A message should be displayed to let the user know what she should provide input.

@fredher fredher added the enhancement New feature or request label Jun 15, 2020
@adl
Copy link

adl commented Jun 15, 2020

Do you really expect users to type the input model on stdin?

What I do in Spot is that when there is no specified input, I use isatty(STDIN_FILENO) to check if stdin is a terminal. In that case I simply display an error message like this:

% ltl2tgba
ltl2tgba: No formula to translate?  Run 'ltl2tgba --help' for help.
Use 'ltl2tgba -' to force reading formulas from the standard input.

Entering formulas interactively is still possible, as the message points out, but without arguments it's much more likely that some user is just trying to figure out how to run the tool, so I prefer to abort.

If stdin has been redirected from a file or pipe, the isatty() check will not abort, and passing - explicitly is not necessary.

@fredher
Copy link
Collaborator Author

fredher commented Jun 15, 2020

Thanks for the advice, it is only meant to be used in piped commands

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

No branches or pull requests

2 participants