experiment
This commit is contained in:
parent
8ecc1e6ff1
commit
595a91df55
|
@ -4,3 +4,5 @@ version = "0.1.0"
|
||||||
authors = ["olivia <olivia@fastmail.com>"]
|
authors = ["olivia <olivia@fastmail.com>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
quicli = "0.2.0"
|
||||||
|
ansi_term = "0.11.0"
|
||||||
|
|
21
src/main.rs
Normal file
21
src/main.rs
Normal 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"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in a new issue