mirror of
https://github.com/yavook/kiwi-scp.git
synced 2024-11-22 21:03:00 +00:00
25 lines
710 B
Python
25 lines
710 B
Python
# local
|
|
from ._subcommand import ProjectCommand
|
|
from .utils.dockercommand import DockerCommand
|
|
|
|
|
|
class CmdCommand(ProjectCommand):
|
|
"""kiwi cmd"""
|
|
|
|
def __init__(self):
|
|
super().__init__(
|
|
'cmd', num_projects=1,
|
|
description="Run raw docker-compose command in a project"
|
|
)
|
|
|
|
# command string after docker-compose
|
|
self._sub_parser.add_argument(
|
|
'compose_cmd', metavar='cmd', type=str,
|
|
help="runs `docker-compose <cmd>`"
|
|
)
|
|
|
|
def run(self, runner, config, args):
|
|
import shlex
|
|
|
|
# run with split compose_cmd argument
|
|
DockerCommand('docker-compose').run(config, args, shlex.split(args.compose_cmd))
|