Would be nice without having to go to bash every time...
Would be nice somebody submits PR:)
Rclone does support
zsh to some extent
$ rclone genautocomplete Generates a shell completion script for rclone. Run with `--help` to list the supported shells. Usage: rclone completion [command] Aliases: completion, genautocomplete Available Commands: bash Output bash completion script for rclone. fish Output fish completion script for rclone. powershell Output powershell completion script for rclone. zsh Output zsh completion script for rclone.
Give it a try!
I know, I have - that's why I said to the remote path extent!
The other completions appear to be there, but only the bash code, longer and seemingly the product of more effort, has the coolest aspect.
Sorry I missed that.
Currently rclone does bash completion only for this here
However I looked at the help
// BashCompletionFunction is custom bash functions used by the legacy bash autocompletion generator. // For portability with other shells, it is recommended to instead use ValidArgsFunction BashCompletionFunction string
And see that way of doing things has been deprecated and we have a new way which will work with all shells
// ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion. // It is a dynamic version of using ValidArgs. // Only one of ValidArgs and ValidArgsFunction can be used for a command. ValidArgsFunction func(cmd *Command, args string, toComplete string) (string, ShellCompDirective)
So we should probably switch over to using that.
I had a quick go at this here
Can you give it a try with fish or zsh?
There seems to be something I don't understand (maybe a bug) which is splitting the input on
: which I put a workaround in for, but it isn't quite right yet.
Very, very quick test with fish and zsh, literally 2 minutes...
Works in both. Nice.
That is encouraging. That code isn't good enough to merge yet as I need to figure out the colon weirdness, but having the completer in go rather than bash is a great step forward.
Another test suggests it is unable to complete a remote path with spaces in. Or one with brackets, it seems.