put: report through the view and ask the host-key question through the Prompter

put() loses its MultiProgress parameter: the summary, pre-flight and
connection spinners become view messages, the per-file SFTP transfer
reports determinate progress through view.progress (upload_file takes
a byte-count callback instead of an indicatif bar), and the display is
released through view.suspend on every exit path. The hardcoded
trust-on-first-use prompt in the SSH host-key verification becomes the
Prompter::accept_host_key port (fail-closed by default; the terminal
prompter prints the authenticity banner and confirms), so a remote
frontend can surface its own host-key dialog.
This commit is contained in:
2026-09-18 20:42:17 +02:00
parent bb76e41908
commit 54cb04ba27
6 changed files with 62 additions and 93 deletions
+5 -1
View File
@@ -564,13 +564,17 @@ fn main() {
std::process::exit(1);
};
let view = pkh::ui::deb::DebUi::new(&multi);
let prompter = pkh::ui::prompt::TerminalPrompter;
let options = pkh::put::PutOptions {
ppa: ppa.to_string(),
changes,
force,
cwd,
view: &view,
prompter: &prompter,
};
if let Err(e) = rt.block_on(async { pkh::put::put(&options, &multi).await }) {
if let Err(e) = rt.block_on(async { pkh::put::put(&options).await }) {
error!("{}", e);
std::process::exit(1);
}