Files
s390-tools/rust/pvebc/src/cli.rs
Marc Hartmayer f8fb9ce32a rust: Run rustfmt with some experimental options
+ Sort and group the imports
+ Normalize and format comments (100 characters width)

Command used:

$ cargo +nightly fmt --

Acked-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <marc@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2026-06-22 16:43:02 +02:00

41 lines
1.4 KiB
Rust

// SPDX-License-Identifier: MIT
//
// Copyright IBM Corp.
use std::path::PathBuf;
use std::sync::OnceLock;
use clap::{ArgAction, Parser, ValueHint};
static VERSION: OnceLock<String> = OnceLock::new();
/// The pvebc command processes an AddSecretRequest file (toc.asr) that defines the root of EBC
/// resources. It validates references to the associated toc.pol policy and manages their addition,
/// with options for verification and dry-run execution.
#[derive(Parser)]
#[command(long_version=ver(), disable_version_flag(true))]
pub struct Cli {
/// Print version information and exit.
#[arg(long, action=ArgAction::Version)]
version: (),
/// Specifies the toc.asr which is the root of the EBC resources
///
/// Specify the add-secret request file toc.asr that serves as the root of the EBC resources.
/// Its user data must contain a reference to toc.pol as generated by pvsecret with the
/// --policy option.
#[arg(short, long, value_name = "FILE", value_hint = ValueHint::FilePath)]
pub toc: PathBuf,
/// Prevents adding of the AddSecretRequest
///
/// Do not add the AddSecretRequest. Use this option to validate a generated policy. It can be
/// run on a non-SEL guest to verify ASR-to-policy links and the associated policy toc.pol.
#[arg(long)]
pub dry_run: bool,
}
fn ver() -> &'static str {
VERSION.get_or_init(|| utils::tools_version_fmt!(2026))
}