summaryrefslogtreecommitdiff
path: root/pi-calc
diff options
context:
space:
mode:
Diffstat (limited to 'pi-calc')
-rwxr-xr-xpi-calc10
1 files changed, 10 insertions, 0 deletions
diff --git a/pi-calc b/pi-calc
new file mode 100755
index 0000000..a108f4b
--- /dev/null
+++ b/pi-calc
@@ -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}))