@@ -166,7 +166,11 @@ def generate_command_models_from_swagger(swagger_tag, workspace_path=None):
166166 expose_value = False ,
167167 help = "Path of `aaz` repository."
168168)
169- def verify ():
169+ @click .option (
170+ "--target" , "-t" ,
171+ help = "Target module to focus on."
172+ )
173+ def verify (target ):
170174 def verify_resource (model , path ):
171175 if "commandGroups" not in model :
172176 return
@@ -196,9 +200,6 @@ def verify_command(file_path):
196200 json_path = os .path .join (Config .AAZ_PATH , os .path .splitext (path )[0 ][1 :] + ".json" )
197201 json_path = os .path .normpath (json_path )
198202
199- if json_path in model_set :
200- continue
201-
202203 if not os .path .exists (json_path ):
203204 raise Exception (f"{ json_path } defined in { file_path } is missing." )
204205
@@ -232,7 +233,13 @@ def verify_command(file_path):
232233
233234 model_set = set ()
234235 aaz = AAZSpecsManager ()
235- stack = [aaz .commands_folder ]
236+
237+ parent = aaz .commands_folder
238+ stack = [os .path .join (parent , target )] if target else [
239+ os .path .join (parent , i )
240+ for i in os .listdir (parent )
241+ if os .path .isdir (os .path .join (parent , i ))
242+ ]
236243
237244 while stack :
238245 curr_path = stack .pop ()
@@ -279,11 +286,12 @@ def verify_command(file_path):
279286 for folder in folders :
280287 stack .append (os .path .join (curr_path , folder ))
281288
282- for root , _ , files in os .walk (aaz .resources_folder ):
283- for file in files :
284- if not file .endswith (".json" ) or file .startswith ("client" ): # support data-plane
285- continue
289+ if not target :
290+ for root , _ , files in os .walk (aaz .resources_folder ):
291+ for file in files :
292+ if not file .endswith (".json" ) or file .startswith ("client" ): # support data-plane
293+ continue
286294
287- file_path = os .path .join (root , file )
288- if file_path not in model_set :
289- raise Exception (f"{ file_path } is redundant." )
295+ file_path = os .path .join (root , file )
296+ if file_path not in model_set :
297+ raise Exception (f"{ file_path } is redundant." )
0 commit comments