Skip to content

Conversation

thehale
Copy link
Member

@thehale thehale commented May 20, 2025

This change allows the tnoodle draw command to read a scramble string from standard input if the -s or --scramble parameter is not explicitly provided. This enables piping the output of tnoodle scramble directly to tnoodle draw.

Key changes:

  • Modified DrawCommand.java to make the scramble parameter optional and to read from System.in if the scramble is not given as an argument.
  • Added robust error handling for cases such as empty stdin or invalid scramble input.
  • Introduced DrawCommandTest.java with unit tests:
    • testDrawCommand_readsFromStdin: Verifies reading a scramble directly from stdin.
    • testFullPipeWorkflow_scrambleToDraw: Verifies the complete workflow of piping tnoodle scramble output to tnoodle draw.
  • Updated README.md to document the new piping feature with an example: tnoodle scramble -p three | tnoodle draw -p three > output.svg.

This change allows the `tnoodle draw` command to read a scramble string
from standard input if the `-s` or `--scramble` parameter is not explicitly
provided. This enables piping the output of `tnoodle scramble` directly to
`tnoodle draw`.

Key changes:
- Modified `DrawCommand.java` to make the `scramble` parameter optional and
  to read from `System.in` if the scramble is not given as an argument.
- Added robust error handling for cases such as empty stdin or invalid
  scramble input.
- Introduced `DrawCommandTest.java` with unit tests:
    - `testDrawCommand_readsFromStdin`: Verifies reading a scramble directly
      from stdin.
    - `testFullPipeWorkflow_scrambleToDraw`: Verifies the complete workflow of
      piping `tnoodle scramble` output to `tnoodle draw`.
- Updated `README.md` to document the new piping feature with an example:
  `tnoodle scramble -p three | tnoodle draw -p three > output.svg`.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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 this pull request may close these issues.

2 participants