aboutsummaryrefslogtreecommitdiff
path: root/src/smp/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/smp/__init__.py')
-rw-r--r--src/smp/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/smp/__init__.py b/src/smp/__init__.py
index f7cb937..2cdf2fe 100644
--- a/src/smp/__init__.py
+++ b/src/smp/__init__.py
@@ -42,6 +42,13 @@ def main():
help="Prefix builtins with smp_",
)
parser.add_argument(
+ "-U",
+ "--unsafe",
+ default=False,
+ action="store_true",
+ help="Allow unsafe code execution",
+ )
+ parser.add_argument(
"file", nargs="?", default=None, help='Input file or "-" for stdin'
)
args = parser.parse_args()
@@ -50,6 +57,8 @@ def main():
macro_processor_state = smp.macro_processor.MacroProcessorState()
prefix = "smp_" if args.prefix_builtins else ""
macro_processor = macro_processor_state.macro_processor(prefix=prefix)
+ if args.unsafe:
+ macro_processor.unsafe_code_execution = True
for key, value in args.D.items():
macro_processor.define_macro(key, value)