From c6352231e43c32bf139cea64d69a4528ef93dedb Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Fri, 3 Nov 2023 20:46:39 +0100 Subject: [PATCH] help: global flags help command now takes glob filter --- cmd/help.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/help.go b/cmd/help.go index 5d2dbce73..ee01b7840 100644 --- a/cmd/help.go +++ b/cmd/help.go @@ -12,6 +12,7 @@ import ( "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/config/configflags" "github.com/rclone/rclone/fs/config/flags" + "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/filter/filterflags" "github.com/rclone/rclone/fs/log/logflags" "github.com/rclone/rclone/fs/rc/rcflags" @@ -62,14 +63,15 @@ var flagsRe *regexp.Regexp // Show the flags var helpFlags = &cobra.Command{ - Use: "flags []", + Use: "flags []", Short: "Show the global flags for rclone", Run: func(command *cobra.Command, args []string) { if len(args) > 0 { - re, err := regexp.Compile(`(?i)` + args[0]) + re, err := filter.GlobStringToRegexp(args[0], false) if err != nil { log.Fatalf("Failed to compile flags regexp: %v", err) } + fs.Debugf(nil, "Flags filter: %s", re.String()) flagsRe = re } if GeneratingDocs {