# Copyright: (c) 2024, Luca Bilke <luca@bil.ke>
# MIT License (see LICENSE)

from __future__ import annotations

from typing import TYPE_CHECKING

from ansible_collections.snailed.ez_compose.plugins.module_utils.service import common as service

if TYPE_CHECKING:
    from ansible_collections.snailed.ez_compose.plugins.module_utils.common import State

def helper(state: State) -> State:
    command = state.module.params.get("command")

    update = {
        "privileged": True,
    }

    if command:
        update["command"] = command

    return service.update(state, update)


def main():
    extra_args = {
        "command": {"type": "list"},
    }
    service.run(extra_args, helper)


if __name__ == "__main__":
    main()