23 lines
535 B
Nim
23 lines
535 B
Nim
import strutils, os, procedures
|
|
|
|
var argument: string
|
|
|
|
if paramCount() > 0:
|
|
argument = toLowerAscii(paramStr(1))
|
|
|
|
let args = [paramStr(0).splitPath.tail, paramStr(0), argument]
|
|
|
|
if "dot" in args or "d" in args:
|
|
dot()
|
|
elif "cross" in args or "c" in args:
|
|
cross()
|
|
else:
|
|
echo "Would you like to preform the dot or cross product?"
|
|
case toLowerAscii(readLine(stdin)):
|
|
of "dot", "d":
|
|
dot()
|
|
of "cross", "c":
|
|
cross()
|
|
else:
|
|
quit "Invalid operation!", QuitFailure
|