-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cylc-bash-complete completes registered suite names when a command takes suite names #2771
Conversation
…word; will complete registered cylc suite names when a command that takes suite names is the second word
…word; will complete registered cylc suite names when a command that takes suite names is the second word
(@matthewrmshin - assigned reviewers who aren't going to be at the workshop next week, but feel free to change). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is amiss at the moment, as I get auto-completion with (further) cylc command keywords instead of suite names after a suite-accepting command, e.g. upon tab completion:
$ cylc run s
scan set-verbosity spawn submit
scp-transfer show start suite-state
search shutdown stop
$ cylc validate r
register remote-init report-timings run
release remote-tidy reset
reload remove restart
Also forgive me but I am not sure what the difference is between:
complete cylc commands if cylc is the first word
and:
complete cylc commands if cylc is the only word
so it is not clear to me what I am testing for in the first case. Can you please clarify this, perhaps with some command-line examples?
The difference is that the current version would always complete commands no matter how many words were on the line
whereas this will (should) only complete for commands if cylc is the only word on the line
^^^ I am not sure why yours is behaving like the current way. Here is the behavior I have. The only thing to come to mind is if the file wasn't sourced.
|
Thanks for clarifying the desired behaviour, & please accept my apologies, as I assumed my With this change actually set-up (!) I get the same tab-completion behaviour you outline above, though obviously with my own local suites returned as suggestions. There are however certain commands that are defined under |
The alias command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - once @sadielbartholomew's two comments are addressed.
Ok, |
Currently cylc-bash-complete will complete cylc commands if cylc is the first word.
This modification will complete cylc commands if cylc is the only word and will complete registered suite names when specific commands (which take suite names) are the second word.
suite_cmds is ugly but I felt manually inputting commands that take suite names was better than completing suite names for all commands.
First time contributing so please let me know if I am missing anything.