1use clap::Parser;
2use expression_format::ex_format;
3use nethsm::{SystemState::Locked, UserRole::Administrator};
4
5use crate::passphrase_file::PassphraseFile;
6
7#[derive(Debug, Parser)]
8#[command(
9 about = "Unlock a device",
10 long_about = ex_format!("Unlock a device using the unlock passphrase
11
12The device must be in state \"{Locked}\".
13
14If no passphrase is provided it is prompted for interactively.
15
16Requires authentication of a user in the \"{Administrator}\" role."),
17)]
18pub struct UnlockCommand {
19 #[arg(
20 env = "NETHSM_UNLOCK_PASSPHRASE_FILE",
21 help = "The path to a file containing the unlock passphrase",
22 long_help = "The path to a file containing the unlock passphrase
23
24The passphrase must be >= 10 and <= 200 characters long.",
25 long,
26 short = 'U'
27 )]
28 pub unlock_passphrase_file: Option<PassphraseFile>,
29}