Comments (3)
I feel the -f
is there to supress file suggestions when one is still fishing for options (with -f
removed one sees file suggestions always). Thus I think it should be triggered from the app and not being hard coded to the command.
from click-completion.
I use this fork for now: https://github.com/flokno/click-completion/tree/fish_complete_files
Any comments/suggestions on how to approach this?
from click-completion.
While using pipenv, which makes use of click-completion, I encountered this problem, too. E.g. pipenv install -r
should complete files, but doesn't, which is annoying. A related issue was reported there pypa/pipenv#3478
I took a look at the code of click-completion. The -f
option mentioned in the first comment is obviously the cause for this. But just removing the -f
would imply that unnecessary file arguments get completed when, for example, just subcommands make sense.
So either the stub fish completion template needs to become more complex (don't know yet how to do that in an universal way) or click-completion needs to emit file completions by itself (and stay with the global -f
).
It looks like this is done for the zsh completion automatically when there are no other explicit arguments to complete. However, the way this is done seems not to work with fish. So maybe this needs indeed to be done with an additional function. The completions for pip (without click-completion) do something like that: https://github.com/pypa/pip/blob/69a811cec64d16f4a3c84f685c50ac319f938772/src/pip/_internal/cli/autocompletion.py#L136
Instead of doing this when there are no other explicit arguments, it could be reasonable to check if the to be completed option is a click file argument https://click.palletsprojects.com/en/master/arguments/#file-arguments (though, I have no experience with click).
Would be great if this can eventually be resolved somehow.
from click-completion.
Related Issues (20)
- zsh completion with "inner" substrings HOT 2
- setup.py relies on old-style extras syntax
- Please tag 0.5.0 HOT 1
- Install fails when running PowerShell from emulated terminal cmder
- Don't suggest hidden commands HOT 1
- zsh: command not found: #compdef HOT 2
- psutil remains should be removed HOT 1
- 'install_requires' must be a string or list of string HOT 3
- Don't suggest hidden options
- No completion for choices with whitespace. HOT 1
- Not working for options defined for comma separated values
- Problem with completion HOT 3
- Click's completion system has been rewritten HOT 1
- No support for PowerShell 7 (PowerShell Core)
- Clarify whether this repo is deprecated or not HOT 5
- How to run install command after pip install ? HOT 1
- click 8.0 compatible code? HOT 3
- Publish "wheel" package in PyPI
- cannot get powershell completion not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from click-completion.