MCPcopy
hub / github.com/hylang/hy / run_command

Function run_command

hy/cmdline.py:32–48  ·  view source on GitHub ↗
(source, filename=None)

Source from the content-addressed store, hash-verified

30
31
32def run_command(source, filename=None):
33 __main__ = importlib.import_module("__main__")
34 require("hy.cmdline", __main__, assignments="ALL")
35
36 with filtered_hy_exceptions():
37 try:
38 hy_eval(
39 read_many(source, filename=filename),
40 __main__.__dict__,
41 __main__,
42 filename=filename,
43 source=source,
44 )
45 except HyLanguageError:
46 hy_exc_handler(*sys.exc_info())
47 return 1
48 return 0
49
50
51USAGE = "hy [-h | -v | -i | -c CMD | -m MODULE | FILE | -] [ARG]..."

Callers 1

cmdline_handlerFunction · 0.85

Calls 5

requireFunction · 0.90
filtered_hy_exceptionsFunction · 0.90
hy_evalFunction · 0.90
read_manyFunction · 0.90
hy_exc_handlerFunction · 0.90

Tested by

no test coverage detected