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

Better handling of stdin, stdout, stderr #150

Closed
3 tasks done
danburzo opened this issue Feb 19, 2023 · 1 comment · Fixed by #151
Closed
3 tasks done

Better handling of stdin, stdout, stderr #150

danburzo opened this issue Feb 19, 2023 · 1 comment · Fixed by #151

Comments

@danburzo
Copy link
Owner

danburzo commented Feb 19, 2023

Percollate can read from stdin when using - (dash) as an operand. To make things a bit more ergonomic, we could consume stdin implicitly when no operands are provided:

  • Consume from stdin when no operand is provided

For text-based formats, such as html, we could also allow output to stdout with the -o - / --output=- option, to offer better composability with other tools that may wish to process the output further:

  • Accept --output=- option for placing the result on stdout.

This requires us to output any progress / diagnostic information to stderr instead of stdout:

  • Log to stderr instead of stdout

Then there's the question of outputting to stdout when multiple inputs are specified along with the --individual flag. Should we just concatenate the results?

danburzo added a commit that referenced this issue Feb 19, 2023
* consume input from 'stdin' when no operands are provided
* output all info/errors to 'stderr'
* allow output HTML to 'stdout' with '-o -' option
@danburzo danburzo removed the Research label Feb 19, 2023
@danburzo
Copy link
Owner Author

All the tasks should be implemented in the PR above. It seems to me this is a breaking change, since:

  • behavior on lack of operands has changed (defaults to stdin)
  • some things have moved from stdout to stderr

danburzo added a commit that referenced this issue Feb 19, 2023
* Fixes #150. Better handling of stdin, stdout, stderr:

* consume input from 'stdin' when no operands are provided
* output all info/errors to 'stderr'
* allow output HTML to 'stdout' with '-o -' option

* Coerce output_path to string before writing to stdout, may be URL (from programmatic API)
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.

1 participant