-
Notifications
You must be signed in to change notification settings - Fork 143
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
Request: _argmatcher::hideargs() function #413
Comments
I agree. If you look in the clink-completions repo, at the file completions/winget.lua, there's an example of how to accomplish it via clink.onfiltermatches(). But it's a little messy and takes more effort than it should. I'm slowly working on some API changes to make it easier and more intuitive to define fancy argmatchers. I'm wrestling with several design decisions, so it's been slow going (on the design side). |
@mjcarman The modules\arghelper.lua module has a bunch of helpers for creating argmatchers, with automatic backward compatibility. It has to be used with require(), as But if you use clink-completions and if your scripts are loaded after the clink-completions scripts (or are in the same directory) then you can simply use New: I've added an Backward compatibility is of course the biggest challenge when making syntax changes to how argmatchers are constructed. That's what is impeding certain kinds of enhancements to argmatchers right now. The arghelper.lua module automatically deals with backward compatibility issues, which is something that of course Clink cannot do on its own. |
@chrisant996 I appreciate your efforts to enhance argmatchers. Thank you! I'll have to update my fork of clink-completions and try I sympathize with the difficulties of backward compatibility. I expect you've already thought of this, but how feasible would it be to add a new optional argument allowing argmatchers to declare their expected API version? (With the default being the current API, of course.) e.g. if an argmatcher declared |
@mjcarman The main problem is that if for example Clink v1.4.15 adds some kind of |
Feature request: Add a new
hideargs()
function to argmatchers. It should behave likehideflags()
but apply to arguments instead of flags. This would be useful for commands that have multiple versions (abbreviations and/or aliases) of the same sub-command. For example, SVN has shorthand versions of most sub-commands (checkout
/co
,status
/stat
/st
) as well as aliases for some (blame
,praise
,annotate
). It would be nice to be able to hide most of these in suggestions while still recognizing them in linked argmatchers.The text was updated successfully, but these errors were encountered: