feat: add is export full data option

pull/200/head
moonD4rk 2 years ago
parent cc4edc5cb6
commit 4b7ad4d505
No known key found for this signature in database
GPG Key ID: 5AB6217E08D39ABA
  1. 5
      cmd/hack-browser-data/main.go

@ -17,6 +17,7 @@ var (
verbose bool verbose bool
compress bool compress bool
profilePath string profilePath string
isFullExport bool
) )
func main() { func main() {
@ -36,6 +37,7 @@ func Execute() {
&cli.StringFlag{Name: "results-dir", Aliases: []string{"dir"}, Destination: &outputDir, Value: "results", Usage: "export dir"}, &cli.StringFlag{Name: "results-dir", Aliases: []string{"dir"}, Destination: &outputDir, Value: "results", Usage: "export dir"},
&cli.StringFlag{Name: "format", Aliases: []string{"f"}, Destination: &outputFormat, Value: "csv", Usage: "file name csv|json"}, &cli.StringFlag{Name: "format", Aliases: []string{"f"}, Destination: &outputFormat, Value: "csv", Usage: "file name csv|json"},
&cli.StringFlag{Name: "profile-path", Aliases: []string{"p"}, Destination: &profilePath, Value: "", Usage: "custom profile dir path, get with chrome://version"}, &cli.StringFlag{Name: "profile-path", Aliases: []string{"p"}, Destination: &profilePath, Value: "", Usage: "custom profile dir path, get with chrome://version"},
&cli.BoolFlag{Name: "full-export", Aliases: []string{"full"}, Destination: &isFullExport, Value: true, Usage: "is export full browsing data"},
}, },
HideHelpCommand: true, HideHelpCommand: true,
Action: func(c *cli.Context) error { Action: func(c *cli.Context) error {
@ -48,12 +50,13 @@ func Execute() {
} }
for _, b := range browsers { for _, b := range browsers {
data, err := b.BrowsingData() data, err := b.BrowsingData(isFullExport)
if err != nil { if err != nil {
log.Error(err) log.Error(err)
} }
data.Output(outputDir, b.Name(), outputFormat) data.Output(outputDir, b.Name(), outputFormat)
} }
if compress { if compress {
if err = fileutil.CompressDir(outputDir); err != nil { if err = fileutil.CompressDir(outputDir); err != nil {
log.Error(err) log.Error(err)

Loading…
Cancel
Save