minor cli improvement
This commit is contained in:
parent
4a34da6ba6
commit
7d23ab9dc6
1 changed files with 4 additions and 2 deletions
|
@ -1,10 +1,10 @@
|
||||||
extern crate cat2text;
|
extern crate cat2text;
|
||||||
use cat2text::{base4, core};
|
use cat2text::{base4, core};
|
||||||
use std::{io, process::exit};
|
use std::{io::{self, stdout, Write}, process::exit};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let stdin = io::stdin();
|
let stdin = io::stdin();
|
||||||
let mut input = String::new();
|
let mut input;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
println!("Pick your translation:");
|
println!("Pick your translation:");
|
||||||
|
@ -12,6 +12,8 @@ fn main() {
|
||||||
println!("2) text to cat");
|
println!("2) text to cat");
|
||||||
input = "".to_string();
|
input = "".to_string();
|
||||||
stdin.read_line(&mut input).unwrap();
|
stdin.read_line(&mut input).unwrap();
|
||||||
|
print!("~> ");
|
||||||
|
stdout().flush().unwrap();
|
||||||
let trimmed = input.trim();
|
let trimmed = input.trim();
|
||||||
if trimmed == "1".to_string() {
|
if trimmed == "1".to_string() {
|
||||||
input = "".to_string();
|
input = "".to_string();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue