Closed mapellidario closed 2 months ago
Jenkins results:
thanks Dario. I am not able to review this. I never knew that generate_completion.py
existed and have no idea how and when to use it. Can you simply describe how things will work ?
Do we need to run it by hand every time we add or remove a command and pipe output to etc/crab-bash-completion.sh ?
Do you intend to have GH do this at any PR or tag ?
And for sure I do not understand the code inside those scripts !
I added a commit with and improved comment that i hope is clear enough.
So, at the moment I think we can use it instead of manually editing the file, which means run this script "only" when we add a crab client command or change an option in an existing command.
In the future we can integrate this as part of the crab client build process, so that the completions are generated for every new deployment. I do not think the effort is worth at the moment.
Jenkins results:
I addressed the some comments from pylint (the ones that i could quickly get rid of without a proper and useless refactoring). If everything goes well, I will merge this PR
Jenkins results:
jenkins looks good to me, i will merge
fixes #5314
status
tested on my laptop, but i have a small question before merging
solution
This PR serves multiple purposes:
-o nosort
incomplete -F _UseCrab -o filenames -o nosort crab
etc/crab-bashpcimpletion.sh
directly, generate it programmatically fromscripts/generate-completions.py
generate-completions.py
work with python3importlib
instead ofimp
generate-completions.py
generate the completion in our desired ordering, see the use of theweights
variable.open questions:
weights
the exact sorting that we have now yet.etc/crab-bash-completion.sh
line 26. the order here is what bash shows when you presscrab <tab><tab>
(the order of line 32 will be the same as line 26)comment
I decided to revamp the
generate_completion.py
script because I did not want to think about adding manually all the new commands introduced withcrab recover
:)