Changed --case-sensitive to --case-insensitive

This commit is contained in:
Seednode 2024-01-19 14:39:53 -06:00
parent 54225d4074
commit 993be0bb7a
2 changed files with 40 additions and 40 deletions

View File

@ -45,7 +45,7 @@ func (filters *filters) apply(fileList []string) []string {
p := filepath.Base(s) p := filepath.Base(s)
for _, exclude := range filters.excluded { 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 return true
} }
} }
@ -59,7 +59,7 @@ func (filters *filters) apply(fileList []string) []string {
p := filepath.Base(s) p := filepath.Base(s)
for _, include := range filters.included { 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 return false
} }
} }

View File

@ -17,46 +17,46 @@ import (
const ( const (
AllowedCharacters string = `^[A-z0-9.\-_]+$` AllowedCharacters string = `^[A-z0-9.\-_]+$`
ReleaseVersion string = "6.1.1" ReleaseVersion string = "6.2.0"
) )
var ( var (
AdminPrefix string AdminPrefix string
All bool All bool
AllowEmpty bool AllowEmpty bool
Audio bool Audio bool
BinaryPrefix bool BinaryPrefix bool
Bind string Bind string
CaseSensitive bool CaseInsensitive bool
Code bool Code bool
CodeTheme string CodeTheme string
Concurrency int Concurrency int
Debug bool Debug bool
DisableButtons bool DisableButtons bool
ExitOnError bool ExitOnError bool
Fallback bool Fallback bool
Filtering bool Filtering bool
Flash bool Flash bool
Fun bool Fun bool
Ignore bool Ignore bool
IgnoreFile string IgnoreFile string
Images bool Images bool
Index bool Index bool
IndexFile string IndexFile string
Info bool Info bool
MaxFileCount int MaxFileCount int
MinFileCount int MinFileCount int
Port int Port int
Prefix string Prefix string
Profile bool Profile bool
Recursive bool Recursive bool
Refresh bool Refresh bool
Russian bool Russian bool
Sorting bool Sorting bool
Text bool Text bool
Verbose bool Verbose bool
Version bool Version bool
Videos bool Videos bool
RequiredArgs = []string{ RequiredArgs = []string{
"all", "all",
@ -120,7 +120,7 @@ func init() {
rootCmd.Flags().BoolVar(&Audio, "audio", false, "enable support for audio files") 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().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().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().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().StringVar(&CodeTheme, "code-theme", "solarized-dark256", "theme for source code syntax highlighting")
rootCmd.Flags().IntVar(&Concurrency, "concurrency", 1024, "maximum concurrency for scan threads") rootCmd.Flags().IntVar(&Concurrency, "concurrency", 1024, "maximum concurrency for scan threads")