-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathoptions.py
39 lines (32 loc) · 940 Bytes
/
options.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import click
def with_fast_option(func):
return click.option(
'--fast',
is_flag=True,
help='Use faster build with prebuilt images',
)(func)
def with_workers_option(func):
return click.option(
'-w', '--workers',
type=int,
metavar='N',
default=1,
help='Number of celery worker instances',
)(func)
def with_external_services_option(func):
wrapped = click.option(
'--redis',
metavar='ADDR',
help='External redis address (disables built-in redis container)',
)(func)
wrapped = click.option(
'--database',
metavar='ADDR',
help='External Postgres address (disables built-in postgres container)',
)(wrapped)
wrapped = click.option(
'--rabbitmq',
metavar='ADDR',
help='External RabbitMQ address (disables built-in rabbitmq container)',
)(wrapped)
return wrapped