6 releases
0.3.0 | Aug 16, 2024 |
---|---|
0.2.1 | Feb 16, 2019 |
0.2.0 | Jan 3, 2018 |
0.1.2 | Jan 23, 2017 |
#105 in Finance
23 downloads per month
23KB
578 lines
Repay
CLI for calculating repayments
Example
repay <<HERE
a 150
b 300
c 100 c a
HERE
c owes b 100.00
a owes b 50.00
How to install
Download from
https://github.com/ramn/repay/releases
or run cargo install repay
.
TODO
- Support semicolon as separator in addition to newline
- Support -h flag
- Support comments the way Bash does it, from #, skip the rest of the line.
lib.rs
:
CLI documentation
Example usage:
$ cargo install repay
$ repay <<HERE
a 150
b 300
c 100 c a
HERE
c owes b 100.00
a owes b 50.00
Library documentation
Example usage:
extern crate repay;
let input =
"a 150
b 300
c 100 c a";
let result = repay::run(input.lines().map(str::to_owned));
assert_eq!(2, result.len());
assert_eq!("c owes b 100.00", format!("{}", result[0]));
assert_eq!("a owes b 50.00", format!("{}", result[1]));
Dependencies
~475KB