diff --git a/cmd/neofs-adm/internal/modules/storagecfg/root.go b/cmd/neofs-adm/internal/modules/storagecfg/root.go index 7f0a3ee56..f06d0911d 100644 --- a/cmd/neofs-adm/internal/modules/storagecfg/root.go +++ b/cmd/neofs-adm/internal/modules/storagecfg/root.go @@ -89,6 +89,9 @@ func storageConfig(cmd *cobra.Command, args []string) { } } + historyPath := filepath.Join(os.TempDir(), "neofs-adm.history") + readline.SetHistoryPath(historyPath) + var c config c.Wallet.Path, _ = cmd.Flags().GetString(walletFlag) @@ -217,8 +220,11 @@ func getWalletAccount(w *wallet.Wallet, prompt string) string { } func getString(prompt string) string { - s, err := input.ReadLine(prompt) + s, err := readline.Line(prompt) fatalOnErr(err) + if s != "" { + _ = readline.AddHistory(s) + } return s } @@ -259,6 +265,8 @@ func getPath(prompt string) string { return p } + _ = readline.AddHistory(p) + abs, err := filepath.Abs(p) if err != nil { fatalOnErr(fmt.Errorf("can't create an absolute path: %w", err))