wmtools/command_wrapper.nim

23 lines
505 B
Nim
Raw Normal View History

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)
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__`"
if run_command != "":
main()