From 4b7ad4d505d8fce73951a2fe920f778fa9c553c0 Mon Sep 17 00:00:00 2001 From: moonD4rk Date: Sat, 11 Mar 2023 17:51:40 +0800 Subject: [PATCH] feat: add is export full data option --- cmd/hack-browser-data/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/hack-browser-data/main.go b/cmd/hack-browser-data/main.go index c2b28a0..5fa6450 100644 --- a/cmd/hack-browser-data/main.go +++ b/cmd/hack-browser-data/main.go @@ -17,6 +17,7 @@ var ( verbose bool compress bool profilePath string + isFullExport bool ) 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: "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.BoolFlag{Name: "full-export", Aliases: []string{"full"}, Destination: &isFullExport, Value: true, Usage: "is export full browsing data"}, }, HideHelpCommand: true, Action: func(c *cli.Context) error { @@ -48,12 +50,13 @@ func Execute() { } for _, b := range browsers { - data, err := b.BrowsingData() + data, err := b.BrowsingData(isFullExport) if err != nil { log.Error(err) } data.Output(outputDir, b.Name(), outputFormat) } + if compress { if err = fileutil.CompressDir(outputDir); err != nil { log.Error(err)