mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
experiment
This commit is contained in:
parent
8ecc1e6ff1
commit
595a91df55
3 changed files with 23 additions and 0 deletions
|
@ -4,3 +4,5 @@ version = "0.1.0"
|
|||
authors = ["olivia <olivia@fastmail.com>"]
|
||||
|
||||
[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