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

changed atty library #351

Merged
merged 2 commits into from
Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ matches = "0.1.6"
byteorder = "1.2.1"
libc = "0.2.1"
getopts = "0.2"
isatty = "0.1"
atty = "0.2"
rand = "0.5.1"
pnet = "0.21.0"
6 changes: 3 additions & 3 deletions src/bin/client-demo.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
extern crate atty;
extern crate env_logger;
extern crate getopts;
extern crate isatty;
extern crate pnet;
extern crate rayon;
extern crate serde_json;
extern crate solana;

use atty::{is, Stream};
use getopts::Options;
use isatty::stdin_isatty;
use pnet::datalink;
use rayon::prelude::*;
use solana::crdt::{Crdt, ReplicatedData};
Expand Down Expand Up @@ -114,7 +114,7 @@ fn main() {
);
assert_eq!(validators.len(), num_nodes);

if stdin_isatty() {
if is(Stream::Stdin) {
eprintln!("nothing found on stdin, expected a json file");
exit(1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/bin/fullnode.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
extern crate atty;
extern crate env_logger;
extern crate getopts;
extern crate isatty;
extern crate serde_json;
extern crate solana;
#[macro_use]
extern crate log;

use atty::{is, Stream};
use getopts::Options;
use isatty::stdin_isatty;
use solana::bank::Bank;
use solana::crdt::ReplicatedData;
use solana::entry::Entry;
Expand Down Expand Up @@ -56,7 +56,7 @@ fn main() {
print_usage(&program, opts);
return;
}
if stdin_isatty() {
if is(Stream::Stdin) {
eprintln!("nothing found on stdin, expected a log file");
exit(1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/bin/genesis-demo.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate isatty;
extern crate atty;
extern crate rayon;
extern crate serde_json;
extern crate solana;

use isatty::stdin_isatty;
use atty::{is, Stream};
use rayon::prelude::*;
use solana::bank::MAX_ENTRY_IDS;
use solana::entry::{next_entry, Entry};
Expand All @@ -15,7 +15,7 @@ use std::process::exit;

// Generate a ledger with lots and lots of accounts.
fn main() {
if stdin_isatty() {
if is(Stream::Stdin) {
eprintln!("nothing found on stdin, expected a json file");
exit(1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/bin/genesis.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//! A command-line executable for generating the chain's genesis block.

extern crate isatty;
extern crate atty;
extern crate serde_json;
extern crate solana;

use isatty::stdin_isatty;
use atty::{is, Stream};
use solana::mint::Mint;
use std::io::{stdin, Read};
use std::process::exit;

fn main() {
if stdin_isatty() {
if is(Stream::Stdin) {
eprintln!("nothing found on stdin, expected a json file");
exit(1);
}
Expand Down
8 changes: 8 additions & 0 deletions src/bin/mint-demo.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
extern crate atty;
extern crate rayon;
extern crate ring;
extern crate serde_json;
extern crate solana;

use atty::{is, Stream};
use solana::mint::{Mint, MintDemo};
use std::io;
use std::process::exit;

fn main() {
let mut input_text = String::new();
if is(Stream::Stdin) {
eprintln!("nothing found on stdin, expected a token number");
exit(1);
}

io::stdin().read_line(&mut input_text).unwrap();
let trimmed = input_text.trim();
let tokens = trimmed.parse::<i64>().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions src/bin/mint.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
extern crate isatty;
extern crate atty;
extern crate serde_json;
extern crate solana;

use isatty::stdin_isatty;
use atty::{is, Stream};
use solana::mint::Mint;
use std::io;
use std::process::exit;

fn main() {
let mut input_text = String::new();
if stdin_isatty() {
if is(Stream::Stdin) {
eprintln!("nothing found on stdin, expected a token number");
exit(1);
}
Expand Down