Files
cproof-plugins/syscmd.py
2016-02-29 23:12:46 +00:00

20 lines
536 B
Python

import prof
import subprocess
def _cmd_system(text):
result = subprocess.Popen(text, shell=True, stdout=subprocess.PIPE).stdout.read()
split = result.splitlines()
for s in split:
prof.cons_show(s)
def prof_init(version, status):
synopsis = [ "/system <command>" ]
description = "Run a system command."
args = [
[ "<command>", "The command" ]
]
examples = [
"/system \"ls -l\""
]
prof.register_command("/system", 1, 1, synopsis, description, args, examples, _cmd_system)