5 releases

0.2.1 Feb 16, 2019
0.2.0 Jan 3, 2018
0.1.2 Jan 23, 2017
0.1.1 Jan 16, 2017
0.1.0 Jan 12, 2017

#211 in Finance

MIT/Apache

21KB
540 lines

Repay

Docs

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