2022-05-06 13:07:22 +02:00
|
|
|
import base
|
|
|
|
import std/[strutils,osproc]
|
|
|
|
|
|
|
|
# Basically just a wrapper to style passmenu nicely
|
|
|
|
proc main() =
|
|
|
|
var info = newInfo(capitalizeAscii(run_command))
|
2022-07-05 14:00:40 +02:00
|
|
|
let cmd = genMenuCmd(info)
|
2022-05-06 13:07:22 +02:00
|
|
|
discard execCmd(cmd)
|
|
|
|
return
|
|
|
|
|
|
|
|
if isMainModule:
|
|
|
|
base.command_wrapper = true
|
|
|
|
for idx, arg in args:
|
|
|
|
case arg:
|
|
|
|
of "-r", "--run":
|
|
|
|
run_command = args[idx + 1]
|
|
|
|
break
|
2022-05-06 13:37:35 +02:00
|
|
|
else:
|
|
|
|
echo "No command given, please run again with `[-r|--run] __cmd__`"
|
2022-05-06 13:07:22 +02:00
|
|
|
|
|
|
|
if run_command != "":
|
|
|
|
main()
|