@@ -51,6 +51,9 @@ def __init__(self, *args, **kwargs):
51
51
"Create or transform a manifest. "
52
52
"Use {} [command] -h for help on each command."
53
53
).format (self .parser .prog )
54
+ subparserActionLength = len (self .parser ._subparsers ._actions )
55
+ initParser = self .parser ._subparsers ._actions [subparserActionLength - 1 ].choices ['init' ]
56
+ initParser .add_argument ('--disable-cert' , help = 'Disable writing the developer certificate to mbed_cloud_dev_credentials.c' )
54
57
55
58
def _addCreateArgs (self , parser , exclusions = []):
56
59
if 'payload' not in exclusions :
@@ -131,10 +134,14 @@ def inner(options):
131
134
"mbed-cli-auto {}" .format (api_key .name ),
132
135
description = "cetificate auto-generated by Mbed CLI"
133
136
)
134
- LOG .info ("Writing developer certificate %s into c file "
137
+ if getattr (options , 'disable_cert' ):
138
+ LOG .warning ("Developer certificate %s not written to "
139
+ "mbed_cloud_dev_credentials.c" , dev_cert_info .name )
140
+ else :
141
+ LOG .info ("Writing developer certificate %s into c file "
135
142
"mbed_cloud_dev_credentials.c" , dev_cert_info .name )
136
- with open ("mbed_cloud_dev_credentials.c" , "w" ) as fout :
137
- fout .write (dev_cert_info .header_file )
143
+ with open ("mbed_cloud_dev_credentials.c" , "w" ) as fout :
144
+ fout .write (dev_cert_info .header_file )
138
145
return func (options )
139
146
return inner
140
147
0 commit comments