From 993be0bb7a4baa43372ff043f2b3135675e8943d Mon Sep 17 00:00:00 2001 From: Seednode Date: Fri, 19 Jan 2024 14:39:53 -0600 Subject: [PATCH] Changed --case-sensitive to --case-insensitive --- cmd/filters.go | 4 +-- cmd/root.go | 76 +++++++++++++++++++++++++------------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/cmd/filters.go b/cmd/filters.go index 2034db2..c8bddd2 100644 --- a/cmd/filters.go +++ b/cmd/filters.go @@ -45,7 +45,7 @@ func (filters *filters) apply(fileList []string) []string { p := filepath.Base(s) for _, exclude := range filters.excluded { - if (CaseSensitive && strings.Contains(p, exclude)) || (!CaseSensitive && strings.Contains(strings.ToLower(p), strings.ToLower(exclude))) { + if (!CaseInsensitive && strings.Contains(p, exclude)) || (CaseInsensitive && strings.Contains(strings.ToLower(p), strings.ToLower(exclude))) { return true } } @@ -59,7 +59,7 @@ func (filters *filters) apply(fileList []string) []string { p := filepath.Base(s) for _, include := range filters.included { - if (CaseSensitive && strings.Contains(p, include)) || (!CaseSensitive && strings.Contains(strings.ToLower(p), strings.ToLower(include))) { + if (!CaseInsensitive && strings.Contains(p, include)) || (CaseInsensitive && strings.Contains(strings.ToLower(p), strings.ToLower(include))) { return false } } diff --git a/cmd/root.go b/cmd/root.go index a5c2edb..50a9a95 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,46 +17,46 @@ import ( const ( AllowedCharacters string = `^[A-z0-9.\-_]+$` - ReleaseVersion string = "6.1.1" + ReleaseVersion string = "6.2.0" ) var ( - AdminPrefix string - All bool - AllowEmpty bool - Audio bool - BinaryPrefix bool - Bind string - CaseSensitive bool - Code bool - CodeTheme string - Concurrency int - Debug bool - DisableButtons bool - ExitOnError bool - Fallback bool - Filtering bool - Flash bool - Fun bool - Ignore bool - IgnoreFile string - Images bool - Index bool - IndexFile string - Info bool - MaxFileCount int - MinFileCount int - Port int - Prefix string - Profile bool - Recursive bool - Refresh bool - Russian bool - Sorting bool - Text bool - Verbose bool - Version bool - Videos bool + AdminPrefix string + All bool + AllowEmpty bool + Audio bool + BinaryPrefix bool + Bind string + CaseInsensitive bool + Code bool + CodeTheme string + Concurrency int + Debug bool + DisableButtons bool + ExitOnError bool + Fallback bool + Filtering bool + Flash bool + Fun bool + Ignore bool + IgnoreFile string + Images bool + Index bool + IndexFile string + Info bool + MaxFileCount int + MinFileCount int + Port int + Prefix string + Profile bool + Recursive bool + Refresh bool + Russian bool + Sorting bool + Text bool + Verbose bool + Version bool + Videos bool RequiredArgs = []string{ "all", @@ -120,7 +120,7 @@ func init() { rootCmd.Flags().BoolVar(&Audio, "audio", false, "enable support for audio files") rootCmd.Flags().BoolVar(&BinaryPrefix, "binary-prefix", false, "use IEC binary prefixes instead of SI decimal prefixes") rootCmd.Flags().StringVarP(&Bind, "bind", "b", "0.0.0.0", "address to bind to") - rootCmd.Flags().BoolVar(&CaseSensitive, "case-sensitive", false, "use case-sensitive matching for filters") + rootCmd.Flags().BoolVar(&CaseInsensitive, "case-insensitive", false, "use case-insensitive matching for filters") rootCmd.Flags().BoolVar(&Code, "code", false, "enable support for source code files") rootCmd.Flags().StringVar(&CodeTheme, "code-theme", "solarized-dark256", "theme for source code syntax highlighting") rootCmd.Flags().IntVar(&Concurrency, "concurrency", 1024, "maximum concurrency for scan threads")