Changed --case-sensitive to --case-insensitive
This commit is contained in:
parent
54225d4074
commit
993be0bb7a
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
76
cmd/root.go
76
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")
|
||||
|
|
Loading…
Reference in New Issue