bwbox/main.nim

20 lines
376 B
Nim
Raw Normal View History

2021-05-18 22:10:35 +02:00
import lib/sandbox
import lib/modes
2021-06-19 16:33:47 +02:00
import lib/args
2021-05-16 20:35:01 +02:00
import strformat
import strutils
2021-06-19 16:33:47 +02:00
import options
2021-05-16 20:35:01 +02:00
import os
2021-06-19 16:33:47 +02:00
proc main(): int =
let mode = parseEnum[Modes](paramStr(0), Modes.Shell)
let args = parseArgs()
2021-05-16 20:35:01 +02:00
2021-06-19 16:33:47 +02:00
if args.isNone:
echo &"Usage: {mode} --command=cmd --profile=profile <sandbox_name>"
return 1
2021-05-18 22:10:35 +02:00
else:
2021-06-19 16:33:47 +02:00
sandboxExec(mode, args.unsafeGet)
2021-05-16 20:35:01 +02:00
2021-06-19 16:33:47 +02:00
quit(main())