mirror of
https://github.com/ivabus/feval
synced 2024-12-04 20:55:06 +03:00
Small fixup
This commit is contained in:
parent
e817323493
commit
941f9c4254
3 changed files with 7 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -10,7 +10,7 @@ checksum = "aacfb566035f8cd02f6ec9247c242f3f9904a0b288ea383abcf4e95df6436a34"
|
|||
|
||||
[[package]]
|
||||
name = "feval"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"evalexpr",
|
||||
]
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -11,10 +11,14 @@ example: feval "math::sin(30 * math::pi / 180)""#);
|
|||
|
||||
fn main() {
|
||||
let args: Vec<String> = 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())
|
||||
|
|
Loading…
Reference in a new issue