diff options
author | d11wtq <chris@w3style.co.uk> | 2014-06-07 08:22:54 +0000 |
---|---|---|
committer | Chris Corbyn <chris@w3style.co.uk> | 2014-06-09 01:31:43 +0000 |
commit | edf6b560167f2ad0b63f17ff402de65d3760f5f9 (patch) | |
tree | 6074d7dfb80fe893722d6e9f9b38737cecb84d11 | |
parent | 8b4ed0c1a8c5da8d1bd650698049491d702684d9 (diff) |
Spike: Add --up option to `fig run`
Signed-off-by: Chris Corbyn <chris@w3style.co.uk>
-rw-r--r-- | fig/cli/main.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fig/cli/main.py b/fig/cli/main.py index f5898645..1e2ea90f 100644 --- a/fig/cli/main.py +++ b/fig/cli/main.py @@ -202,9 +202,10 @@ class TopLevelCommand(Command): $ fig run web python manage.py shell - Note that this will not start any services that the command's service - links to. So if, for example, your one-off command talks to your - database, you will need to run `fig up -d db` first. + Note that by default this will not start any services that the + command's service links to. So if, for example, your one-off command + talks to your database, you will need to either run `fig up -d db` + first, or use `fig run --up SERVICE COMMAND [ARGS...]`. Usage: run [options] SERVICE COMMAND [ARGS...] @@ -214,7 +215,13 @@ class TopLevelCommand(Command): -T Disable pseudo-tty allocation. By default `fig run` allocates a TTY. --rm Remove container after run. Ignored in detached mode. + --up Also start services that the command's service links to """ + + if options['--up']: + # FIXME: I'm not sure if this is good python form + self.up({'-d': True, 'SERVICE': None}) + service = self.project.get_service(options['SERVICE']) tty = True |