Change a couple of flags, -i for case

This commit is contained in:
Laurence Withers 2023-05-13 10:22:58 +01:00
parent 2bbfc3bc30
commit b438aef169
1 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ which can be repeated multiple times. -e specifies a regular expression and
-Q a fixed pattern. When using either flag, any non-flag arguments are treated -Q a fixed pattern. When using either flag, any non-flag arguments are treated
as paths to scan. as paths to scan.
Search defaults to case-sensitive but the -I flag may be passed to make regular Search defaults to case-sensitive but the -i flag may be passed to make regular
expression searches case-insensitive. Alternatively, the "(?i)" construct may be expression searches case-insensitive. Alternatively, the "(?i)" construct may be
added to a regular expression to make that specific expression case insensitive. added to a regular expression to make that specific expression case insensitive.
Fixed pattern matches are always case-sensitive.`, Fixed pattern matches are always case-sensitive.`,
@ -70,8 +70,8 @@ var (
func init() { func init() {
rootCmd.Flags().StringSliceVarP(&searchRegexp, "grep", "e", nil, "pattern to match (regular expression)") rootCmd.Flags().StringSliceVarP(&searchRegexp, "grep", "e", nil, "pattern to match (regular expression)")
rootCmd.Flags().StringSliceVarP(&searchFixed, "fixed", "Q", nil, "pattern to match (fixed string)") rootCmd.Flags().StringSliceVarP(&searchFixed, "fixed", "Q", nil, "pattern to match (fixed string)")
rootCmd.Flags().StringSliceVarP(&ignoreList, "ignore", "i", []string{".git"}, "files/directories to ignore") rootCmd.Flags().StringSliceVarP(&ignoreList, "exclude", "x", []string{".git"}, "files/directories to exclude")
rootCmd.Flags().BoolVarP(&ignoreCase, "ignore-case", "I", false, "make all searches case insensitive") rootCmd.Flags().BoolVarP(&ignoreCase, "ignore-case", "i", false, "make all searches case insensitive")
} }
func run(c *cobra.Command, args []string) error { func run(c *cobra.Command, args []string) error {