Skip to content

Commit

Permalink
Allow --verbose in front of input
Browse files Browse the repository at this point in the history
  • Loading branch information
probablykasper committed Apr 21, 2021
1 parent ca27377 commit c7ee968
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ use cpc::units::Unit;
/// cpc CLI interface
fn main() {
use std::env;
let args: Vec<String> = env::args().collect();
let mut args: Vec<String> = env::args().collect();
let mut verbose = false;
if args.iter().any(|i| i == "-v" || i == "--verbose") {
if let Some(pos) = args.iter().position(|x| x == "-v" || x == "--verbose") {
verbose = true;
args.remove(pos);
}
if args.len() >= 2 {
match eval(&args[1], true, Unit::Celsius, verbose) {
Expand Down

0 comments on commit c7ee968

Please sign in to comment.