From 941f9c4254c3ac7b535591ef55721dc5bdd04ab0 Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Wed, 25 Jan 2023 22:13:28 +0300 Subject: [PATCH] Small fixup --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f13fbf5..c48b68a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "aacfb566035f8cd02f6ec9247c242f3f9904a0b288ea383abcf4e95df6436a34" [[package]] name = "feval" -version = "0.1.0" +version = "0.1.1" dependencies = [ "evalexpr", ] diff --git a/Cargo.toml b/Cargo.toml index 33b1686..083320e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "feval" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "clt for fast evaluations" readme = "README.md" diff --git a/src/main.rs b/src/main.rs index e67dfc0..b6ee903 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,10 +11,14 @@ example: feval "math::sin(30 * math::pi / 180)""#); fn main() { let args: Vec = args().collect(); - if args.len() != 2 { + if args.len() > 2 { println!("Too many args."); help(); return + } else if args.len() < 2 { + println!("Too few args."); + help(); + return } let expr = all(args[1].clone()); println!("{}", evalexpr::eval(&expr).unwrap())