23 lines
511 B
Nim
23 lines
511 B
Nim
|
import ../../base
|
||
|
import std/[strutils,osproc]
|
||
|
|
||
|
# Basically just a wrapper to style passmenu nicely
|
||
|
proc main() =
|
||
|
var info = newInfo(capitalizeAscii(run_command))
|
||
|
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
|
||
|
else:
|
||
|
echo "No command given, please run again with `[-r|--run] __cmd__`"
|
||
|
|
||
|
if run_command != "":
|
||
|
main()
|