Global Feed Post Login
Replying to Avatar fiatjaf

Suppose you're using a CLI too that takes multiline input from stdin and processes it one line at a time, printing the results of each line sequentially.

What is the correct behavior in case one of these stdin lines causes an error? To immediately halt the execution or to print an error message to stderr and continue on the next line? Do you have an example of a CLI tool that does it right?

Avatar
Braydon Fuller 2y ago

I think it depends on if each line is serial, if not then probably okay to continue. Either print the stderr or wait and print it before closing (or possibly botth). The cli for rsync, could be close.

Reply to this note

Please Login to reply.

Discussion

No replies yet.