Skip to content
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

More complete bash completion #1580

Merged
merged 4 commits into from
Feb 5, 2016

Conversation

damienfrancois
Copy link
Contributor

This PR extends existing bash completion in easybuild (completing on parameters only) with completion on easyconfigs (from local dir and from robot search path)

Documentation should be updated to read

source `dirname $(which eb)`/minimal_bash_completion.bash
source `dirname $(which eb)`/optcomplete.bash
source `dirname $(which eb)`/eb_bash_completion.bash
complete -F _eb eb

and instruct the user to add that to their shell startup file.

edit: depends on #1577

@hpcugentbot
Copy link
Contributor

Automatic reply from Jenkins: Can I test this?

@boegel boegel added this to the v2.7.0 milestone Feb 5, 2016
@boegel
Copy link
Member

boegel commented Feb 5, 2016

@damienfrancois: please merge damienfrancois#1 to get a clear view on your changes

I'd love to get this in ASAP.

@boegel
Copy link
Member

boegel commented Feb 5, 2016

Hmm, just gave this a quick test, I'm running into this when trying eb --h<TAB>:

$ eb --hbash: unexpected EOF while looking for matching `''
bash: syntax error: unexpected end of file

edit: with:

bash-3.2$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)
Copyright (C) 2007 Free Software Foundation, Inc.

@boegel
Copy link
Member

boegel commented Feb 5, 2016

OK, nevermind on the latter, apparently the bash included in OS X is ancient.

It works on our login nodes, which have bash 4.1.2

@boegel
Copy link
Member

boegel commented Feb 5, 2016

Jenkins: ok to test

@hpcugentbot
Copy link
Contributor

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2617/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Contributor

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2619/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@boegel
Copy link
Member

boegel commented Feb 5, 2016

@damienfrancois: you have the complete -F _eb eb in the script to be sourced that you're adding, so we shouldn't mention this in the docs, right?

@boegel
Copy link
Member

boegel commented Feb 5, 2016

I see no reason to hold this back, so going in!

Wiki page https://github.com/hpcugent/easybuild/wiki/Setting-up-tab-completion-for-bash has been updated, I'll port this to http://easybuild.readthedocs.org later.

@boegel
Copy link
Member

boegel commented Feb 5, 2016

Thanks a lot for looking into this @damienfrancois!

boegel added a commit that referenced this pull request Feb 5, 2016
@boegel boegel merged commit 6aad970 into easybuilders:develop Feb 5, 2016
@damienfrancois damienfrancois deleted the bash_completion branch February 7, 2016 20:16
@brevans
Copy link
Contributor

brevans commented Jan 10, 2017

How do you all feel about this being added to the module for eb? It feels cleaner than having to load eb in an rc file to ensure that this works properly.

@boegel
Copy link
Member

boegel commented Jan 10, 2017

@brevans What do you mean specifically? The sourcing of the provided script?

@brevans
Copy link
Contributor

brevans commented Jan 10, 2017

Yes. The sourcing the three .bash files and the complete command. Doing this could also handle loading different versions of easybuild better, no?

@boegel
Copy link
Member

boegel commented Jan 10, 2017

How would you actually do that in the EasyBuild module file? Are we talking about the same thing here, i.e. the module file that is generated by the EasyBuild bootstrap procedure, and which you need to load with module load EasyBuild?

@ocaisa
Copy link
Member

ocaisa commented Jan 10, 2017 via email

@brevans
Copy link
Contributor

brevans commented Jan 10, 2017

@boegel yes, the module file that you use to load EasyBuild after installation.

You can use the execute function. Adding the following to the EasyBuild/3.0.2.lua file works for me in bash.

execute{cmd="source `dirname $(which eb)`/minimal_bash_completion.bash",modeA={"load"}}
execute{cmd="source `dirname $(which eb)`/optcomplete.bash",modeA={"load"}}
execute{cmd="source `dirname $(which eb)`/eb_bash_completion.bash",modeA={"load"}}
execute{cmd="complete -F _eb eb",modeA={"load"}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants