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"));
}
}
});