shadow_crypt_shell/listing/
cli.rs1use clap::{Parser, error::ErrorKind};
2
3use crate::errors::WorkflowError;
4
5#[derive(Debug, Clone, Parser)]
7#[command(
8 name = "shadows",
9 about = "List shadow files in the current directory",
10 version
11)]
12pub struct ListingCliArgs {}
13
14pub fn get_cli_args(args: Vec<String>) -> Result<ListingCliArgs, WorkflowError> {
16 ListingCliArgs::try_parse_from(args).map_err(|e| {
17 if e.kind() == ErrorKind::DisplayHelp || e.kind() == ErrorKind::DisplayVersion {
19 eprintln!("{}", e);
21 std::process::exit(0);
22 }
23 WorkflowError::UserInput(e.to_string())
24 })
25}