simple command dependencies

This commit is contained in:
Jörn-Michael Miehe 2020-08-17 10:57:45 +02:00
parent 387b7406b5
commit 4c70b7b2c1
6 changed files with 6 additions and 6 deletions

View file

@ -36,7 +36,7 @@ class Runner:
logging.debug(f"Running '{cmd}' with args: {args}") logging.debug(f"Running '{cmd}' with args: {args}")
try: try:
cmd.run(LoadedConfig.get(), args) cmd.run(self, LoadedConfig.get(), args)
except KeyboardInterrupt: except KeyboardInterrupt:
print() print()

View file

@ -20,7 +20,7 @@ class SubCommand:
def __str__(self): def __str__(self):
return self.__name return self.__name
def run(self, config, args): def run(self, runner, config, args):
"""actually run command with this dir's config and parsed CLI args""" """actually run command with this dir's config and parsed CLI args"""
pass pass

View file

@ -18,7 +18,7 @@ class CmdCommand(ProjectCommand):
help="runs `docker-compose <cmd>`" help="runs `docker-compose <cmd>`"
) )
def run(self, config, args): def run(self, runner, config, args):
import shlex import shlex
# run with split compose_cmd argument # run with split compose_cmd argument

View file

@ -18,7 +18,7 @@ class LogsCommand(ServiceCommand):
help="output appended data as log grows" help="output appended data as log grows"
) )
def run(self, config, args): def run(self, runner, config, args):
# include timestamps # include timestamps
compose_cmd = ['logs', '-t'] compose_cmd = ['logs', '-t']

View file

@ -82,7 +82,7 @@ class ShCommand(ServiceCommand):
help="shell to spawn" help="shell to spawn"
) )
def run(self, config, args): def run(self, runner, config, args):
compose_cmd = ['exec', args.services[0]] compose_cmd = ['exec', args.services[0]]
shell = _find_shell(config, args, compose_cmd) shell = _find_shell(config, args, compose_cmd)

View file

@ -11,5 +11,5 @@ class ShowCommand(SubCommand):
description="Show effective kiwi.yml" description="Show effective kiwi.yml"
) )
def run(self, config, args): def run(self, runner, config, args):
print(config) print(config)