Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cylc/cylc-flow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4b4fff6190abe1fd21fc3d8a6583782eb245da98
Choose a base ref
..
head repository: cylc/cylc-flow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 36c88f4cd57daaf31276af134567f2548a2e66f5
Choose a head ref
Showing with 16 additions and 15 deletions.
  1. +16 −15 cylc/flow/scripts/cylc.py
31 changes: 16 additions & 15 deletions cylc/flow/scripts/cylc.py
Original file line number Diff line number Diff line change
@@ -63,22 +63,23 @@ def main(command, cmd_args, help_):
elif command:
cylc_cmd = f"cylc-{command}"

possible_cmds = [
cmd for cmd in command_list if cmd.startswith(cylc_cmd)
]
if len(possible_cmds) == 0:
click.echo(f"cylc {command}: unknown utility. Abort.")
click.echo('Type "cylc help all" for a list of utilities.')
return -1
elif len(possible_cmds) > 1:
click.echo(
"cylc $1: is ambiguous for: {}".format(
[cmd[5:] for cmd in possible_cmds]
if cylc_cmd not in command_list:
possible_cmds = [
cmd for cmd in command_list if cmd.startswith(cylc_cmd)
]
if len(possible_cmds) == 0:
click.echo(f"cylc {command}: unknown utility. Abort.")
click.echo('Type "cylc help all" for a list of utilities.')
return -1
elif len(possible_cmds) > 1:
click.echo(
"cylc {}: is ambiguous for: {}".format(
command, [cmd[5:] for cmd in possible_cmds]
)
)
)
return -1
else:
cylc_cmd = possible_cmds[0]
return -1
else:
cylc_cmd = possible_cmds[0]

if help_:
execute_cmd(cylc_cmd, "--help")