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:
Roger authored and GitHub committed 2026-11-10 17:00:44 +08:00
1 parent a7741eaab2
commit b5eddf799b
21 files changed
+281 -266

No files matched your search

+3 -2
View File
@@ -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
}