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

Add Bash completion #170

Merged
merged 1 commit into from
Dec 23, 2015
Merged

Add Bash completion #170

merged 1 commit into from
Dec 23, 2015

Conversation

FedericoCeratto
Copy link
Member

No description provided.

@dom96
Copy link
Collaborator

dom96 commented Dec 23, 2015

Nice!

dom96 added a commit that referenced this pull request Dec 23, 2015
@dom96 dom96 merged commit 886bb4f into nim-lang:master Dec 23, 2015
local cur=${COMP_WORDS[COMP_CWORD]}
local prev=${COMP_WORDS[COMP_CWORD-1]}
COMPREPLY=()
_init_completion || return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line gives an error on my system (OSX). I simply removed it.. Is this working on Linux?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FedericoCeratto
Copy link
Member Author

@oderwat it is.

@oderwat
Copy link
Contributor

oderwat commented Jan 7, 2016

Well Macs bash completion doesn't have this for the installed version of the completion. One could add a minimal version which looks like this:

__my_init_completion()
{
    COMPREPLY=()
    _get_comp_words_by_ref cur prev words cword
}

# called like this example
local cur prev words cword
if declare -F _init_completions >/dev/null 2>&1; then
 _init_completion -s || return
else
  __my_init_completion || return
fi

But afais it is not at all needed for your completion code and works without it. Why not remove it or just call it if it is available?

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.

3 participants