1
0
Fork 0
mirror of https://github.com/rust-lang/rustlings.git synced 2024-05-12 01:06:08 +02:00

experiment

This commit is contained in:
olivia 2018-05-06 18:59:50 +02:00
parent 8ecc1e6ff1
commit 595a91df55
3 changed files with 23 additions and 0 deletions

View File

@ -4,3 +4,5 @@ version = "0.1.0"
authors = ["olivia <olivia@fastmail.com>"]
[dependencies]
quicli = "0.2.0"
ansi_term = "0.11.0"

View File

21
src/main.rs Normal file
View File

@ -0,0 +1,21 @@
#[macro_use] extern crate quicli;
extern crate ansi_term;
use quicli::prelude::*;
use ansi_term::Colour::{Red, Yellow};
#[derive(Debug, StructOpt)]
struct Cli {
exercise: Option<String>,
}
main!(|args: Cli| {
match args.exercise {
Some(e) => {
println!("selected {}", e);
}
None => {
println!("Welcome to {}", Yellow.paint("Rustlings"));
}
}
});