mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
cmd: make auto completion work for all shells and reduce the size
This updates the bash completion to work with GenBashCompletionV2 which cuts down the size of the completion file dramatically. See: https://forum.rclone.org/t/request-make-remote-path-completion-work-for-fish-and-zsh/42982/ See: #7000
This commit is contained in:
@@ -38,7 +38,7 @@ If output_file is "-", then the output will be written to stdout.
|
||||
out := "/etc/bash_completion.d/rclone"
|
||||
if len(args) > 0 {
|
||||
if args[0] == "-" {
|
||||
err := cmd.Root.GenBashCompletion(os.Stdout)
|
||||
err := cmd.Root.GenBashCompletionV2(os.Stdout, false)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -46,7 +46,7 @@ If output_file is "-", then the output will be written to stdout.
|
||||
}
|
||||
out = args[0]
|
||||
}
|
||||
err := cmd.Root.GenBashCompletionFile(out)
|
||||
err := cmd.Root.GenBashCompletionFileV2(out, false)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user