Skip to content

Commit

Permalink
Make sure a single letter is needed to exit the private stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
cr-fuel committed Oct 31, 2023
1 parent 5686e72 commit cf550c6
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 11 deletions.
48 changes: 48 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bin/keygen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ description = "Command line utilities for fuel-core key management"
anyhow = { workspace = true }
atty = "0.2.14"
clap = { workspace = true, features = ["derive", "env"] }
crossterm = "0.27.0"
fuel-core-keygen = { workspace = true }
serde_json = { workspace = true, features = ["raw_value"] }
termion = "2.0.1"
16 changes: 5 additions & 11 deletions bin/keygen/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
//! A simple keygen cli utility tool for configuring fuel-core
use atty::Stream;
use clap::Parser;
use fuel_core_keygen::{
new_key,
parse_secret,
KeyType,
};
use std::io::{
stdin,
stdout,
Read,
Write,
};
use crossterm::terminal;
use fuel_core_keygen::{new_key, parse_secret, KeyType};
use std::io::{stdin, stdout, Read, Write};
use termion::screen::IntoAlternateScreen;

/// Parse a secret key to view the associated public key
Expand Down Expand Up @@ -79,7 +71,9 @@ fn main() -> anyhow::Result<()> {

fn wait_for_keypress() {
let mut single_key = [0u8];
terminal::enable_raw_mode().expect("enable_raw_mode failed");
stdin().read_exact(&mut single_key).unwrap();
terminal::disable_raw_mode().expect("disable_raw_mode failed");
}

fn display_string_discreetly(
Expand Down

0 comments on commit cf550c6

Please sign in to comment.