12 lines
339 B
Python
12 lines
339 B
Python
from typing import Optional
|
|
from . import mappers
|
|
|
|
MAPPERS = {"curl": mappers.CurlMapper,
|
|
"xargs": mappers.XargsMapper}
|
|
|
|
|
|
def convert_command(command: list[str], input_name: Optional[str]):
|
|
mapper_cls = MAPPERS.get(command[0], mappers.ShellMapper)
|
|
mapper = mapper_cls(command)
|
|
return mapper.generate(input_name, ["bytes"])
|