mirror of
https://github.com/guilhermewerner/rust-cli
synced 2025-06-15 14:35:15 +00:00
Create Sample Rust CLI App
This commit is contained in:
13
Cargo.toml
Normal file
13
Cargo.toml
Normal 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
20
Source/Console.rs
Normal 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),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user