Skip to content

Commit

Permalink
Handle EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcph4 committed Jan 26, 2025
1 parent daa091f commit c08f191
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ impl FromStr for Method {
pub async fn send_rpc(opts: Opts) -> eyre::Result<()> {
let mut buf = String::new();
std::io::stdin().read_line(&mut buf)?;

if buf.is_empty() {
return Ok(());
}

let req = if opts.raw {
buf
} else {
Expand Down

0 comments on commit c08f191

Please sign in to comment.