Skip to content

Commit 0ef56e8

Browse files
committed
Merge branch 'cwl-desc' of github-perso:bird-house/goldfinch into cwl-desc
2 parents 3ef246e + 070db4e commit 0ef56e8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/goldfinch/utils/click2cwl_cli.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def resolve_cli_command(
118118
"-c", "--command",
119119
metavar="COMMAND",
120120
default=None,
121-
type=click.Path(exists=True, dir_okay=False),
122121
help="If the python script defines multiple commands, this can be used to specify which one to convert.",
123122
)
124123
@click.option(
@@ -229,12 +228,13 @@ def main(ctx: click.Context, **kwargs: str) -> None:
229228
cli_spec.loader.exec_module(cli_mod)
230229

231230
# find the decorated Click function to convert
232-
click_functions = [
233-
(name, member)
234-
for name, member in
235-
inspect.getmembers(cli_mod)
236-
if (not name.startswith("_") or kwargs["command"] == name) and isinstance(member, click.Command)
237-
]
231+
click_functions = []
232+
for name, member in inspect.getmembers(cli_mod):
233+
if isinstance(member, click.Command) and not name.startswith("_"):
234+
if kwargs["command"] and kwargs["command"] != name:
235+
continue
236+
click_functions.append((name, member))
237+
238238
if len(click_functions) != 1:
239239
names = [name for name, _ in click_functions]
240240
raise ValueError(

0 commit comments

Comments
 (0)