1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-07-01 00:45:17 +02:00

add --test run flag

This commit is contained in:
liv
2019-01-09 22:04:08 +01:00
parent 17e12433cb
commit 141db7795b
3 changed files with 11 additions and 2 deletions

View File

@ -1,10 +1,18 @@
use crate::util::clean;
use crate::verify::test;
use console::{style, Emoji};
use indicatif::ProgressBar;
use std::process::Command;
pub fn run(matches: clap::ArgMatches) {
if let Some(filename) = matches.value_of("file") {
if matches.is_present("test") {
match test(filename) {
Ok(_) => (),
Err(_) => (),
}
std::process::exit(0);
}
let bar = ProgressBar::new_spinner();
bar.set_message(format!("Compiling {}...", filename).as_str());
bar.enable_steady_tick(100);