Skip to content

Commit 1ebfe71

Browse files
authored
Merge pull request #169 from GATEOverflow/dev
Fixes for help, support --all in search
2 parents 940c151 + 46dc484 commit 1ebfe71

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

mlc/main.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,12 @@ def search(self, i):
6464
uid = item_split[1]
6565
else:
6666
uid = item_split[0]
67-
for res in target_index:
68-
c_tags = res["tags"]
69-
if set(p_tags).issubset(set(c_tags)) and set(n_tags).isdisjoint(set(c_tags)) and (not uid or uid == res['uid']) and (not alias or alias == res['alias']):
70-
it = Item(res['path'], res['repo'])
71-
result.append(it)
67+
if tags or uid or i.get('all'):
68+
for res in target_index:
69+
c_tags = res["tags"]
70+
if set(p_tags).issubset(set(c_tags)) and set(n_tags).isdisjoint(set(c_tags)) and (not uid or uid == res['uid']) and (not alias or alias == res['alias']):
71+
it = Item(res['path'], res['repo'])
72+
result.append(it)
7273
#logger.info(result)
7374
return {'return': 0, 'list': result}
7475
#indices

mlc/script_action.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ def call_script_module_function(self, function_name, run_args):
234234
result = automation_instance.test(run_args) # Pass args to the run method
235235
elif function_name == "experiment":
236236
result = automation_instance.experiment(run_args) # Pass args to the experiment method
237+
elif function_name == "help":
238+
result = automation_instance.help(run_args) # Pass args to the help method
237239
elif function_name == "doc":
238240
result = automation_instance.doc(run_args) # Pass args to the doc method
239241
elif function_name == "lint":
@@ -300,6 +302,7 @@ def run(self, run_args):
300302
Example Command:
301303
302304
mlc run script --tags=detect,os -j
305+
mlcr detect,os -j
303306
304307
Options:
305308
@@ -308,6 +311,8 @@ def run(self, run_args):
308311
3. *<Individual script inputs>: The `mlcr` command can accept additional inputs defined in the script's `input_mappings` metadata.
309312
310313
"""
314+
if not run_args.get('tags') and not run_args.get('details'):
315+
return self.call_script_module_function("help", run_args)
311316
return self.call_script_module_function("run", run_args)
312317

313318

0 commit comments

Comments
 (0)