Files
s390-tools/rust/pvverify/src/cli.rs
Marc Hartmayer f0a148fd0b rust: Fix cargo clippy false positives
Add allow attributes for intentional patterns in pvverify and pvsecret.

Command line used to get the findings:

  $ clippy --all-features -- --cap-lints=warn
  ...
  help: remove this field
    --> pvverify/src/cli.rs:22:5
     |
  22 |     version: (),
     |     ^^^^^^^^^^^
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
     = note: `#[warn(clippy::manual_non_exhaustive)]` on by default
  help: use the `#[non_exhaustive]` attribute instead
     |
  16 + #[non_exhaustive]
  17 | pub struct CliOptions {
     |

  warning: struct `AddSecretOptComb` is never constructed
     --> pvsecret/src/cli.rs:313:12
      |
  313 | pub struct AddSecretOptComb<'a> {
      |            ^^^^^^^^^^^^^^^^
      |
      = note: `-W dead-code` implied by `-W unused`
      = help: to override `-W unused` add `#[expect(dead_code)]` or `#[allow(dead_code)]`

  warning: struct `ListSecretOptComb` is never constructed
     --> pvsecret/src/cli.rs:355:12
      |
  355 | pub struct ListSecretOptComb<'a> {
      |            ^^^^^^^^^^^^^^^^^

  warning: struct `RetrSecretOptionsComb` is never constructed
     --> pvsecret/src/cli.rs:490:12
      |
  490 | pub struct RetrSecretOptionsComb<'a> {
      |            ^^^^^^^^^^^^^^^^^^^^^

Assisted-by: IBM Bob:1.0.4
Reviewed-by: Timo Keller <tkeller@linux.ibm.com>
Reviewed-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-25 14:14:43 +02:00

31 lines
879 B
Rust

// SPDX-License-Identifier: MIT
//
// Copyright IBM Corp. 2025
use std::sync::OnceLock;
use clap::{ArgAction, Parser};
use utils::CertificateOptions;
static VERSION: OnceLock<String> = OnceLock::new();
#[derive(Parser, Debug)]
#[command(long_version=ver(), disable_version_flag(true))]
/// Tool to verify host-keys
///
/// Tool to verify host-keys. Use this tool to verify the chain of trust for IBM Secure
// Allow manual_non_exhaustive to suppress Clippy false positive as the version
// field is used by Clap to generate the --version flag.
#[allow(clippy::manual_non_exhaustive)]
pub struct CliOptions {
#[command(flatten)]
pub certificate_args: CertificateOptions,
#[arg(long, action=ArgAction::Version)]
/// Print version information and exit.
version: (),
}
fn ver() -> &'static str {
VERSION.get_or_init(|| utils::tools_version_fmt!(2025))
}