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

🐛 fix --stdin CLI option #57

Closed
wants to merge 8 commits into from

Conversation

AucaCoyan
Copy link
Contributor

Description of changes

WIP

Relevant Issues

#56

@amtoine amtoine linked an issue Dec 17, 2023 that may be closed by this pull request
src/main.rs Outdated Show resolved Hide resolved
@AucaCoyan AucaCoyan marked this pull request as ready for review December 28, 2023 18:31
@AucaCoyan
Copy link
Contributor Author

Thank you @amtoine ! With your help I could solve the issue 😄

Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes look ok to me, but i'm not sure they address the original issue 🤔

i'm running the following, on top of the PR branch and after a cargo clean:

  • cargo build --release to create ./target/release/nufmt
  • foo out> foo.txt to create a dummy file

and then

  1. ./target/release/nufmt --stdin (open foo.txt) still works as before
  2. open foo.txt | ./target/release/nufmt gives an error
  3. open foo.txt | ./target/release/nufmt --stdin also gives an error

i expected

  • 1. to not work anymore
  • 2. to give an error as it did
  • 3. to work as 1. does

@AucaCoyan
Copy link
Contributor Author

Hello! I break the API and forgot to tell you 😆 . Thank you for listing every case.
Reading it one more time today, I realized I made a mistake on the assignment. Let's see if I can fix it 😄

@AucaCoyan AucaCoyan marked this pull request as draft March 30, 2024 23:20
@NomisIV NomisIV mentioned this pull request Jul 15, 2024
@AucaCoyan
Copy link
Contributor Author

superseded by #61

@AucaCoyan AucaCoyan closed this Jul 15, 2024
fdncred pushed a commit that referenced this pull request Jul 15, 2024
## Description of changes

`--stdin` flag read a command line argument, not stdin. Now it reads
from stdin.

Not sure if my code would compile on windows, but I don't have a windows
computer to test it.

I'm aware that #57 tries to solve
this as well, but it seems stagnant and won't pass CI.

## Relevant Issues

#56
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.

--stdin doesn't read stdin
2 participants