From d459fb0cb8305ce7311d9d72f513e30de51cbe12 Mon Sep 17 00:00:00 2001 From: pawsey-kbuckley <36438302+pawsey-kbuckley@users.noreply.github.com> Date: Tue, 16 Apr 2024 00:00:43 +0800 Subject: [PATCH] genautocomplete: remove Ubuntu-ism from docs and clarify non-root use --- cmd/genautocomplete/genautocomplete_bash.go | 27 +++++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/cmd/genautocomplete/genautocomplete_bash.go b/cmd/genautocomplete/genautocomplete_bash.go index b956f68fa..2b8d22b49 100644 --- a/cmd/genautocomplete/genautocomplete_bash.go +++ b/cmd/genautocomplete/genautocomplete_bash.go @@ -18,20 +18,31 @@ var bashCommandDefinition = &cobra.Command{ Long: ` Generates a bash shell autocompletion script for rclone. -This writes to /etc/bash_completion.d/rclone by default so will -probably need to be run with sudo or as root, e.g. +By default, when run without any arguments, - sudo rclone genautocomplete bash + rclone genautocomplete bash -Logout and login again to use the autocompletion scripts, or source -them directly +the generated script will be written to - . /etc/bash_completion + /etc/bash_completion.d/rclone -If you supply a command line argument the script will be written -there. +and so rclone will probably need to be run as root, or with sudo. + +If you supply a path to a file as the command line argument, then +the generated script will be written to that file, in which case +you should not need root privileges. If output_file is "-", then the output will be written to stdout. + +If you have installed the script into the default location, you +can logout and login again to use the autocompletion script. + +Alternatively, you can source the script directly + + . /path/to/my_bash_completion_scripts/rclone + +and the autocompletion functionality will be added to your +current shell. `, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(0, 1, command, args)