qsandbox/nim/qsandbox.nim

34 lines
569 B
Nim
Raw Permalink Normal View History

2021-11-17 09:14:41 +01:00
import parseopt
import commands/help
import commands/list
import commands/qemu
import commands/run
import commands/ssh
proc cmd (options: OptParser) =
case options.key:
of "qemu":
qemu(options)
of "run":
run(options)
of "ssh":
ssh(options)
of "list":
list(options)
else:
help(options)
proc main () =
var options = initOptParser()
options.next()
case options.kind
of cmdEnd: help(options)
of cmdShortOption, cmdLongOption:
echo "Unkown argument"
quit(1)
of cmdArgument:
cmd(options)
main()