@@ -19,7 +19,9 @@ def cli():
1919
2020@click .command (help = 'Create a new function for Lambda.' )
2121@click .option (
22- '--minimal' , default = False , is_flag = True ,
22+ '--minimal' ,
23+ default = False ,
24+ is_flag = True ,
2325 help = 'Exclude any unnecessary template files' ,
2426)
2527@click .argument (
@@ -36,14 +38,23 @@ def init(folder, minimal):
3638
3739
3840@click .command (help = 'Bundles package for deployment.' )
39- @click .option ('--config-file' , default = 'config.yaml' , help = 'Alternate config file.' )
4041@click .option (
41- '--use-requirements' , default = False , is_flag = True ,
42+ '--config-file' ,
43+ default = 'config.yaml' ,
44+ help = 'Alternate config file.' ,
45+ )
46+ @click .option (
47+ '--use-requirements' ,
48+ default = False ,
49+ is_flag = True ,
4250 help = 'Install all packages defined in requirements.txt' ,
4351)
4452@click .option (
45- '--local-package' , default = None , type = click .Path (),
46- help = 'Install local package as well.' , multiple = True ,
53+ '--local-package' ,
54+ default = None ,
55+ type = click .Path (),
56+ help = 'Install local package as well.' ,
57+ multiple = True ,
4758)
4859def build (use_requirements , local_package , config_file ):
4960 aws_lambda .build (
@@ -55,8 +66,16 @@ def build(use_requirements, local_package, config_file):
5566
5667
5768@click .command (help = 'Run a local test of your function.' )
58- @click .option ('--event-file' , default = 'event.json' , help = 'Alternate event file.' )
59- @click .option ('--config-file' , default = 'config.yaml' , help = 'Alternate config file.' )
69+ @click .option (
70+ '--event-file' ,
71+ default = 'event.json' ,
72+ help = 'Alternate event file.' ,
73+ )
74+ @click .option (
75+ '--config-file' ,
76+ default = 'config.yaml' ,
77+ help = 'Alternate config file.' ,
78+ )
6079@click .option ('--verbose' , '-v' , is_flag = True )
6180def invoke (event_file , config_file , verbose ):
6281 aws_lambda .invoke (
@@ -68,14 +87,23 @@ def invoke(event_file, config_file, verbose):
6887
6988
7089@click .command (help = 'Register and deploy your code to lambda.' )
71- @click .option ('--config-file' , default = 'config.yaml' , help = 'Alternate config file.' )
7290@click .option (
73- '--use-requirements' , default = False , is_flag = True ,
91+ '--config-file' ,
92+ default = 'config.yaml' ,
93+ help = 'Alternate config file.' ,
94+ )
95+ @click .option (
96+ '--use-requirements' ,
97+ default = False ,
98+ is_flag = True ,
7499 help = 'Install all packages defined in requirements.txt' ,
75100)
76101@click .option (
77- '--local-package' , default = None , type = click .Path (),
78- help = 'Install local package as well.' , multiple = True ,
102+ '--local-package' ,
103+ default = None ,
104+ type = click .Path (),
105+ help = 'Install local package as well.' ,
106+ multiple = True ,
79107)
80108def deploy (use_requirements , local_package , config_file ):
81109 aws_lambda .deploy (
@@ -88,27 +116,40 @@ def deploy(use_requirements, local_package, config_file):
88116
89117@click .command (help = 'Upload your lambda to S3.' )
90118@click .option (
91- '--use-requirements' , default = False , is_flag = True ,
119+ '--use-requirements' ,
120+ default = False ,
121+ is_flag = True ,
92122 help = 'Install all packages defined in requirements.txt' ,
93123)
94124@click .option (
95- '--local-package' , default = None , type = click .Path (),
96- help = 'Install local package as well.' , multiple = True ,
125+ '--local-package' ,
126+ default = None ,
127+ type = click .Path (),
128+ help = 'Install local package as well.' ,
129+ multiple = True ,
97130)
98131def upload (use_requirements , local_package ):
99132 aws_lambda .upload (CURRENT_DIR , use_requirements , local_package )
100133
101134
102135@click .command (help = 'Deploy your lambda via S3.' )
103- @click .option ('--config-file' , default = 'config.yaml' , help = 'Alternate config file.' )
104136@click .option (
105- '--use-requirements' , default = False , is_flag = True , help = (
106- 'Install all packages defined in requirements.txt'
107- ),
137+ '--config-file' ,
138+ default = 'config.yaml' ,
139+ help = 'Alternate config file.' ,
140+ )
141+ @click .option (
142+ '--use-requirements' ,
143+ default = False ,
144+ is_flag = True ,
145+ help = 'Install all packages defined in requirements.txt' ,
108146)
109147@click .option (
110- '--local-package' , default = None , type = click .Path (),
111- multiple = True , help = 'Install local package as well.' ,
148+ '--local-package' ,
149+ default = None ,
150+ type = click .Path (),
151+ multiple = True ,
152+ help = 'Install local package as well.' ,
112153)
113154def deploy_s3 (use_requirements , local_package , config_file ):
114155 aws_lambda .deploy_s3 (
@@ -119,11 +160,15 @@ def deploy_s3(use_requirements, local_package, config_file):
119160
120161
121162@click .command (help = 'Delete old versions of your functions' )
122- @click .option ('--config-file' , default = 'config.yaml' , help = 'Alternate config file.' )
123163@click .option (
124- '--keep-last' , type = int , prompt = (
125- 'Please enter the number of recent versions to keep'
126- ),
164+ '--config-file' ,
165+ default = 'config.yaml' ,
166+ help = 'Alternate config file.' ,
167+ )
168+ @click .option (
169+ '--keep-last' ,
170+ type = int ,
171+ prompt = 'Please enter the number of recent versions to keep' ,
127172)
128173def cleanup (keep_last , config_file ):
129174 aws_lambda .cleanup_old_versions (
0 commit comments