Create Sample Rust CLI App

This commit is contained in:
GuilhermeWerner
2021-01-18 20:24:23 -03:00
parent d42b39065f
commit f34081ea8b
2 changed files with 33 additions and 0 deletions

13
Cargo.toml Normal file
View File

@ -0,0 +1,13 @@
[package]
name = "RustCLI"
version = "0.0.1"
description = "Rust CLI"
repository = "https://github.com/GuilhermeWerner/RustCLI"
authors = ["GuilhermeWerner <guilhermeqwerner@gmail.com>"]
license = "MIT"
edition = "2018"
publish = false
[[bin]]
name="Console"
path = "Source/Console.rs"

20
Source/Console.rs Normal file
View File

@ -0,0 +1,20 @@
// Copyright (c) TribuFu 2015-2020. All Rights Reserved
#![allow(non_snake_case)]
use std::io::{self, Read};
fn main() {
println!("Hello World");
loop {
let mut input = String::new();
match io::stdin().read_line(&mut input) {
Ok(n) => {
print!("{}", input);
}
Err(error) => panic!("{}", error),
}
}
}