minor cli improvement

This commit is contained in:
askiiart 2025-01-13 15:59:05 -06:00
parent 4a34da6ba6
commit 7d23ab9dc6
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A

View file

@ -1,10 +1,10 @@
extern crate cat2text;
use cat2text::{base4, core};
use std::{io, process::exit};
use std::{io::{self, stdout, Write}, process::exit};
fn main() {
let stdin = io::stdin();
let mut input = String::new();
let mut input;
loop {
println!("Pick your translation:");
@ -12,6 +12,8 @@ fn main() {
println!("2) text to cat");
input = "".to_string();
stdin.read_line(&mut input).unwrap();
print!("~> ");
stdout().flush().unwrap();
let trimmed = input.trim();
if trimmed == "1".to_string() {
input = "".to_string();