diff options
author | Aki <please@ignore.pl> | 2021-12-22 23:25:36 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-12-22 23:25:36 +0100 |
commit | e617261dd12e3db9e2c547040147390a0135d6c5 (patch) | |
tree | cab67a2ccc98dc7e63328fc2794f1d091b4315df /pi-calc | |
download | pi-calc-e617261dd12e3db9e2c547040147390a0135d6c5.zip pi-calc-e617261dd12e3db9e2c547040147390a0135d6c5.tar.gz pi-calc-e617261dd12e3db9e2c547040147390a0135d6c5.tar.bz2 |
Diffstat (limited to 'pi-calc')
-rwxr-xr-x | pi-calc | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -0,0 +1,10 @@ +#!/usr/bin/env lua +local C = require "Calculator" +local M = require "Material" +local Q = require "Quantity" +local material, amount = ... +if not material then + error("expected material name as an argument") +end +amount = tonumber(amount) or 1 +C.pretty_print(C.raw_materials_needed(Q{amount, material})) |