-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Feature request: cli tab auto-completion #96
Comments
Regarding the first point, maestral already has basic support for tab auto-completion. You can activate it by running the following in your shell or adding it to your startup script (such as For zsh: eval "$(_MAESTRAL_COMPLETE=source_zsh maestral)" For bash: eval "$(_MAESTRAL_COMPLETE =source_bash maestral)" For fish: eval (env _MAESTRAL_COMPLETE =source_fish maestral) This is currently not done automatically but could be done in the future. The second point is a bit more difficult. Auto-completing Dropbox paths would either require fetching them from the server (always up-to-date but potentially very high latency for a large number of items) or from a local cache such as the currently downloaded plus the top-level excluded paths. This is unlikely to be part of the next release but I will keep it in mind. In the meantime, your life could be a bit easier if you enclose the whole path in quotes instead of escaping all spaces with a backslash... |
many thanks - I see you are already having a new branch to add the first point. Regarding the second point. Latency is an issue for sure, but it applies to other successful instances of the idea as well. for example, in Arch linuc, the package manager Alternatively, I guess one can use some form of local database (which should anyway be is used for syncing). The issues there are:
I can see that this may be a nightmare to code, so most probably simply querying the server and accepting some lag may be best, if this feature is ever to be implemented. |
So, I have been looking into this for both local paths (currently not supported either) and remote paths. I agree that the best option is to fetch remote paths directly from Dropbox servers. However, making either of this play nicely with different shells will involve a lot of work. Maestral uses click to implement its CLI and click itself is currently redesigning their autocompletion to work better with paths and different shells: pallets/click#1484. It does not make sense for me start working on this myself before this is completed. For now, I am experimenting with a convenience command to install autocompletion functions for the user's shell - but those will only use the currently built-in support. |
makes perfect sense. many thanks! |
It looks like click 8.0 will be released soon with much improved for shell completion. The documentation for their development version is already available here. This should be a good starting point to support shell completion in maestral beyond the default that click provides, for instance to include auto-completion for Dropbox paths. |
Not a bug, but a request. As it stands, the cli does not support tab auto-completion for commands and/or filenames. It would be nice to be able to be able to type for example, "maestral ex\t" and autocomplete the command for exclusion.
Perhaps more importantly, it would be also great if such auto-completion works for dropbox folder and file names, for example in the ls and exclude commands. Expanding on this last point, there are often cases where folders or files include spaces, which (at least for Linux) should be replaced by '\ '. Right now I have to manually write sometimes long folder names in the cli, or copy and paste them but then manually add backslashes to all the spaces. If tab could autocomplete these correctly, it would be a time saver.
Once again, many thanks for your great work on this.
The text was updated successfully, but these errors were encountered: