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

Fish completions, function with same name #3158

Closed
FabioAntunes opened this Issue Jun 20, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@FabioAntunes

FabioAntunes commented Jun 20, 2016

I'm having a hard time with completions and a function I have created.

function npm -d "node package manager"
  __nvm_run "npm" $argv
end

So this function basically calls __nvm_run checks if nvm has already sourced node, if not sources it and then runs npm, if node is already sourced then it just runs npm.

That function creates this issue #3152

If I change the function to this:

function npm -d "node package manager" -c npm -w npm
   echo "This won't run"
  __nvm_run "npm" $argv
end

The completions works fine, but the function it's not called anymore.

any help?


For 2.3.1 release:

  • Update release notes
@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Jun 20, 2016

Member

The latter is a broken function definition - there's no "-c" option to "function", so the definition is invalid. That it doesn't print an error is #2827 (though it appears it also applies to short options, despite what the title says).

The rest is #3152, so I'll close this as a duplicate of that, and it seems that the blame lies with the __nvm_run function.

Member

faho commented Jun 20, 2016

The latter is a broken function definition - there's no "-c" option to "function", so the definition is invalid. That it doesn't print an error is #2827 (though it appears it also applies to short options, despite what the title says).

The rest is #3152, so I'll close this as a duplicate of that, and it seems that the blame lies with the __nvm_run function.

@faho faho closed this Jun 20, 2016

@faho faho added the duplicate label Jun 20, 2016

@FabioAntunes

This comment has been minimized.

Show comment
Hide comment
@FabioAntunes

FabioAntunes Jun 20, 2016

I'm sorry but I don't think there's something wrong with my function, if you create a function like this:

function npm -d "node package manager" -w npm
  command npm $argv
end

You wil get the same result from #3152

FabioAntunes commented Jun 20, 2016

I'm sorry but I don't think there's something wrong with my function, if you create a function like this:

function npm -d "node package manager" -w npm
  command npm $argv
end

You wil get the same result from #3152

@FabioAntunes

This comment has been minimized.

Show comment
Hide comment
@FabioAntunes

FabioAntunes Jun 20, 2016

In fact if I create a function with a different name let's say npm2, everything works fine:

function npm2 -d "node package manager" -w npm
  __nvm_run "npm" $argv
end

FabioAntunes commented Jun 20, 2016

In fact if I create a function with a different name let's say npm2, everything works fine:

function npm2 -d "node package manager" -w npm
  __nvm_run "npm" $argv
end
@FabioAntunes

This comment has been minimized.

Show comment
Hide comment
@FabioAntunes

FabioAntunes Jun 20, 2016

@faho I submited a pull request that fixes the issue with completions

FabioAntunes commented Jun 20, 2016

@faho I submited a pull request that fixes the issue with completions

@faho faho reopened this Jun 21, 2016

@faho faho removed the duplicate label Jun 21, 2016

@faho faho closed this in 3a0d417 Jun 21, 2016

@faho faho added this to the 2.3.1 milestone Jun 21, 2016

faho added a commit that referenced this issue Jun 21, 2016

npm completions: Call command npm
npm is often wrapped by a function.

Fixes #3158.

(cherry picked from commit 3a0d417)

faho added a commit that referenced this issue Jun 21, 2016

faho added a commit that referenced this issue Jun 21, 2016

npm completions: Check command npm existence
Really fixes #3158 and #3152.

(cherry picked from commit 10661bb)

floam added a commit to floam/fish-shell that referenced this issue Jul 4, 2016

npm completions: Call command npm
npm is often wrapped by a function.

Fixes fish-shell#3158.

floam added a commit to floam/fish-shell that referenced this issue Jul 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment