From 595a91df555fc71f3075ea78649b267665151d1d Mon Sep 17 00:00:00 2001 From: olivia Date: Sun, 6 May 2018 18:59:50 +0200 Subject: [PATCH] experiment --- Cargo.toml | 2 ++ src/lib.rs | 0 src/main.rs | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+) delete mode 100644 src/lib.rs create mode 100644 src/main.rs diff --git a/Cargo.toml b/Cargo.toml index ec00628..5f5c8a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,5 @@ version = "0.1.0" authors = ["olivia "] [dependencies] +quicli = "0.2.0" +ansi_term = "0.11.0" diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e69de29..0000000 diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..abbd3b8 --- /dev/null +++ b/src/main.rs @@ -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, +} + +main!(|args: Cli| { + match args.exercise { + Some(e) => { + println!("selected {}", e); + } + None => { + println!("Welcome to {}", Yellow.paint("Rustlings")); + } + } +});