24 lines
658 B
Nim
24 lines
658 B
Nim
import strutils, os, procedures, terminal
|
|
|
|
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:
|
|
styledEcho resetStyle, "Would you like to preform the ", styleBright, "dot ", resetStyle, "or ", styleBright, "cross ", resetStyle, "product?"
|
|
case toLowerAscii(readLine(stdin)):
|
|
of "dot", "d":
|
|
dot()
|
|
of "cross", "c":
|
|
cross()
|
|
else:
|
|
styledEcho fgRed, "Invalid operation!"
|
|
quit QuitFailure
|