run

package
v0.0.0-...-8851a85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = cobra.Command{
	Use:   "run",
	Short: "Execute the scanner",
	Long:  color.GreenString(helpLong),
	Run: func(cmd *cobra.Command, args []string) {
		scan.Exec(func() error {
			scanner := new(scan.Scanner)
			scanner.SetPath(dir)
			switch mode {
			case "md5":
				scanner.SetMatcher(new(scan.Md5Matcher))
			case "hex":
				scanner.SetMatcher(new(scan.HexMatcher))
			default:
				return errors.New("Match search pattern is not sure")
			}
			if code == "" {
				return errors.New("Match value can not be empty can be md5 or hexadecimal string")
			}
			if res, err := scanner.Search(code); err != nil {
				return err
			} else {
				scan.Output(out, scanner, res)
				table.WriteTables(table.CommonTemplate, res)
			}
			return nil
		})
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL