mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-12-04 05:43:27 +01:00
refactor(app): typed per-command options, render in cmd (#693)
Validate now returns only what each command reads, with -b resolved to browsers or vaults, so no stage compares against "all"; printing moves to cmd, which already printed the list tables.
This commit is contained in:
1 parent
a7741eaab2
commit
b5eddf799b
21 files changed
+281
-266
No files matched your search
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
@@ -43,7 +44,7 @@ func newRestoreCommand() *cobra.Command {
|
||||
}
|
||||
|
||||
func runRestore(ctx context.Context, stderr io.Writer, flags app.RestoreFlags) error {
|
||||
options, keyFile, err := app.ValidateRestore(flags)
|
||||
options, err := app.ValidateRestore(flags, os.Stdin)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -53,7 +54,7 @@ func runRestore(ctx context.Context, stderr io.Writer, flags app.RestoreFlags) e
|
||||
}
|
||||
defer closeRestoreData(root)
|
||||
|
||||
discovery, keys, err := app.DiscoverRestore(root.Path(), keyFile, options.Target.BrowserName)
|
||||
discovery, keys, err := app.DiscoverRestore(root.Path(), options.Vaults)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user