public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Gabriel Goller <g.goller@proxmox.com>
Cc: Thomas Lamprecht <t.lamprecht@proxmox.com>, pbs-devel@lists.proxmox.com
Subject: Re: [pbs-devel] [PATCH proxmox v6 1/2] router: cli: add confirmation helper
Date: Mon, 3 Jun 2024 10:13:03 +0200	[thread overview]
Message-ID: <so466c56n2dqtz42emdvypoxnxp4z254qn5zwcvbggtq3wp4gw@pisp7rmc3cad> (raw)
In-Reply-To: <20240426123720.110120-2-g.goller@proxmox.com>

Missed something in the first response:
We should `use anyhow::Error` rather than using `Result<_, anyhow::Error>`
everywhere.

On Fri, Apr 26, 2024 at 02:37:15PM GMT, Gabriel Goller wrote:
> Add confirmation helper that outputs a prompt and lets the user
> confirm or deny it.
> Implemented to close #4763.
> 
> Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
> Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
> ---
>  proxmox-router/Cargo.toml     |   1 +
>  proxmox-router/src/cli/mod.rs | 113 +++++++++++++++++++++++++++++++++-
>  2 files changed, 113 insertions(+), 1 deletion(-)
> 
> diff --git a/proxmox-router/Cargo.toml b/proxmox-router/Cargo.toml
> index dcd71a4..0b9d361 100644
> --- a/proxmox-router/Cargo.toml
> +++ b/proxmox-router/Cargo.toml
> @@ -19,6 +19,7 @@ percent-encoding.workspace = true
>  serde_json.workspace = true
>  serde.workspace = true
>  unicode-width ="0.1.8"
> +regex.workspace = true
>  
>  # cli:
>  tokio = { workspace = true, features = [], optional = true }
> diff --git a/proxmox-router/src/cli/mod.rs b/proxmox-router/src/cli/mod.rs
> index 7df94ad..d13caa5 100644
> --- a/proxmox-router/src/cli/mod.rs
> +++ b/proxmox-router/src/cli/mod.rs
> @@ -12,7 +12,11 @@
>  //! - Ability to create interactive commands (using ``rustyline``)
>  //! - Supports complex/nested commands
>  
> -use std::collections::HashMap;
> +use std::{
> +    collections::HashMap,
> +    io::{self, Write},
> +};

(And add an empty line in between the std and external `use` group
please.)

> +use anyhow::bail;
>  
>  use crate::ApiMethod;
>  


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


  parent reply	other threads:[~2024-06-03  8:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 12:37 [pbs-devel] [PATCH proxmox{, -backup} v6 0/2] close #4763: client: add command to forget backup group Gabriel Goller
2024-04-26 12:37 ` [pbs-devel] [PATCH proxmox v6 1/2] router: cli: add confirmation helper Gabriel Goller
2024-06-03  8:10   ` Wolfgang Bumiller
2024-06-03  8:13   ` Wolfgang Bumiller [this message]
2024-04-26 12:37 ` [pbs-devel] [PATCH proxmox-backup v6 2/2] close #4763: client: add command to forget backup group Gabriel Goller
2024-06-03  8:03   ` Wolfgang Bumiller
2024-06-03  8:42     ` Gabriel Goller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=so466c56n2dqtz42emdvypoxnxp4z254qn5zwcvbggtq3wp4gw@pisp7rmc3cad \
    --to=w.bumiller@proxmox.com \
    --cc=g.goller@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal