Skip to content

Commit 26099bd

Browse files
author
梶塚太智
committed
Update main.rs
Append option `mem-used` of command `sys-info`
1 parent cfb3486 commit 26099bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,10 @@ impl Executor {
11341134
Ok(info) => Type::Number(info.total as f64),
11351135
Err(_) => Type::Error("sys-info".to_string()),
11361136
},
1137+
"mem-used" => match mem_info() {
1138+
Ok(info) => Type::Number((info.total - info.free) as f64),
1139+
Err(_) => Type::Error("sys-info".to_string()),
1140+
},
11371141
_ => Type::Error("sys-info".to_string()),
11381142
})
11391143
}

0 commit comments

Comments
 (0)