Skip to content

Commit

Permalink
fix(cmd): correct bind flag to name regex option
Browse files Browse the repository at this point in the history
Signed-off-by: Massimiliano Giovagnoli <[email protected]>
  • Loading branch information
maxgio92 committed Jul 4, 2023
1 parent 5f60913 commit f00caf5
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions cmd/find/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ limitations under the License.
package find

import (
"fmt"

"github.com/pkg/errors"
"github.com/spf13/cobra"

Expand All @@ -43,13 +41,7 @@ func NewCmd() *cobra.Command {
RunE: o.Run,
}

var filename string

cmd.Flags().StringVarP(&filename, "name", "n", ".+", "Base of file name (the path with the leading directories removed) exact pattern.")

// As of now only exact glob pattern expressions are allowed. The expression then translated to an exact-match regular expression.
o.FilenameRegexp = fmt.Sprintf("^%s$", filename)

cmd.Flags().StringVarP(&o.FilenameRegexp, "name", "n", ".+", "Base of file name (the path with the leading directories removed) exact pattern.")
cmd.Flags().StringVarP(&o.FileType, "type", "t", "", "The file type")
cmd.Flags().BoolVarP(&o.Verbose, "verbose", "v", false, "Enable verbosity to log all visited HTTP(s) files")
cmd.Flags().BoolVarP(&o.Recursive, "recursive", "r", true, "Whether to examine entries recursing into directories. Disable to behave like GNU find -maxdepth=0 option.")
Expand Down

0 comments on commit f00caf5

Please sign in to comment.