Re: [PATCH v3 2/5] client: repository: add individual component parameters

Wolfgang Bumiller
2026-04-02T08:54:18Z

On Thu, 02 Apr 2026 00:48:58 +0200, Thomas Lamprecht <t.lamprecht@proxmox.com> wrote:
> diff --git a/pbs-client/src/backup_repo.rs b/pbs-client/src/backup_repo.rs
> index 45c859d67..c899dc277 100644
> --- a/pbs-client/src/backup_repo.rs
> +++ b/pbs-client/src/backup_repo.rs
> @@ -1,8 +1,156 @@
> [ ... skip 128 lines ... ]
> + fn try_from(args: BackupRepositoryArgs) -> Result<Self, Self::Error> {
> + let has_url = args.repository.is_some();
> + let has_atoms = args.has_atoms();
> +
> + if has_url && has_atoms {
> + bail!("--repository and --server/--port/--datastore/--auth-id are mutually exclusive");

Since we have this twice, should we have a
`BackupRepositoryArgs::check()?` to deduplicate the error message?
(It would then also be easy to (later) extend the struct to also contain
info about where the components came from to produce a more accurate
error message if things were merged).

--