-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement completion of cmd line arguments and options of the command line #482
Comments
Disussed and if it goes to a server it is beyond autocomplete. Thus pywbemcli --name could autocomplete ut not pywbemcli class get. For the class get we can use the .? wildcard. I think this means that the only real autocomplete is the --name option. |
The directions issue #582 for 0.7.0 defines this as a prio 1 item for 0.7.0. |
We agreed to lower the priority of this one to no longer be prio 1 in the directions issue. |
Moved to 0.8.0. |
Karl needs to define the alternatives for tab completion and our ? selection to decide if we should use both concepts, or select one. We noted that autocompletion does not exist on shells like cmd.exe. We may not be able to do much with the shell mode with cmd.exe because there is no support for any auto-completion except for file names. And there is no mechanism to extend the cmd.exe auto-completion (ex. bash allows defining new auto-autocompletion with a script and env variable) We could tab on those things that we already use tabs for (commands, subcommands, option names) that are are supported by by the interactive mode using click. RESPONSE/KS: Yes we need both capabilities since we do not plan to build capabilities to access a server into the shell tab-completion at this point. This is made even more complex in that doing completion on functionality like namespaces or the instancename will require that we set clear ordering requirements on the options themselves. Thus, for example it would not make sense to to tab completion on the the instancename argument in instance get without already having the namespace itself defined on the command name or part of the instancename. Finally, further we made the ? completion different from what is the norm for tab-completion in that it is a GLOB, not a starts-with type of completion. CONCLUSION: KS - I think that the only possible change to cover this question would be to extend documentation so users understand the difference. We should be sure that these GLOB base completions are clearly documented as different from the tab-completion that will be part of the comand an interactive mode tabe-completion. |
For the initial release of any tab-completion the following are out of scope KS List of places in pywbemcli that are logical for auto/wildcard completion.
|
The click project is in process of a major rework of the click-auto-complete components. (see click issue #1484 and a corresponding pr in progress). We do not have a date but I would argue that any work we do on expanding auto-complete (i.e. tab-completion completion) would probably be wasted. There goals appear to be 1) rewrite the code base to make it more comphrehensible and adapt to more platforms including powershell, 2 implement more type based auto-complete (specifically file and path based tab completion) 3. apparently implement a means to offer completion tied to particular options, etc. In light of that I propose that it is not worthwhile for us to tackle anything involving tab-based auto-completion (ex. use the click completion contribution library) until the click work settles down. Sadly we don't have any idea how long that will be. Thus, if we were to consider our wildcard (? / select) based completion for specific options and arguments that would be logical however. But first we must define whether we want to use that means of auto-complete. |
We agreed to put anything involving tab completion off pending better understanding of where click is going. |
It is now clear that the update to click for auto-completion is primarily about:
However:
|
DISCUSSION: Where should we go and what kind of deadlines should we set with respect to supporting:
Setting our goals and the external forces that are driving those goals (ex. pip and python 2.7) will help us understand what paths we should take in satisfying some of the items we want to accomplish but that are limited by python versions. Curently we have issues with:
|
Proposal:
The key question is can this be done without getting crazy with version dependencies in our code. |
This is tied to the the use of click 8 so we cannot do this until we can use click 8 (see issue # 819). Remove target release |
This is partly duplicated in issue #1158 that sets requirement for documenting and adding support for autocomete on the cmd line. I suggest that I combine the two issues more logically so that one covers basic implementation of the addons and documentation of autocompete on the cmd line (#1158) and that this one cover just issues around extending how autocomplete is used for getting option and parameter/option values since the concept of auto-complete for parameters values was added in click 8.0 |
Click provides the capability to activate shell completion for command and options in both click 7 and 8. However in click 8 the
capability was added for doing tab-completion on values of options also including files/paths, and other options where pywbemcli itself could provide the completion information. The user must add the capability to defined the tab-completion for option values and there are a couple of ways to do it in click 8:
a) adding a new attribute (shell_completion) to option definition where the value of that attribute defined a completion option for the option.
b) Create a custom ParamType for the option/argument for which custom value tab-completion is to be used.
See https://click.palletsprojects.com/en/8.1.x/shell-completion/
Click provides the capability to activate shell completion for command and options in both click 7 and 8. However in click 8 the
capability was added for doing tab-completion on values of options also including files/paths, and other options where pywbemcli itself could provide the completion information. The user must add the capability to defined the tab-completion for option values and there are a couple of ways to do it in click 8:
a) adding a new attribute (shell_completion) to option definition where the value of that attribute defined a completion option for the option.
b) Create a custom ParamType for the option/argument for which custom value tab-completion is to be used.
See https://click.palletsprojects.com/en/8.1.x/shell-completion/
The immediate goal is to implement tab completion for those option values that where the data is available locally such as choice options, the --name options, any options that access files or paths. Options that access the server itself will require that we find ways to cache information from the server and access the cached information locally and are beyond the current scope.
The text was updated successfully, but these errors were encountered: