secrets_cli/
opts.rs

1use clap::{Args, Parser, Subcommand};
2use std::path::PathBuf;
3
4#[derive(Parser, Debug)]
5#[command(author, version)]
6#[command(about = "Secrets CLI", long_about = "A CLI for managing secrets")]
7pub struct Opts {
8    #[command(subcommand)]
9    pub action: Action,
10}
11
12#[derive(Subcommand, Debug, PartialEq)]
13pub enum Action {
14    #[command(about = "Copy the secrets")]
15    Copy(Project),
16    #[command(about = "Show the secrets")]
17    Show(Project),
18    #[command(about = "Transform to fish shell")]
19    Fish(Project),
20    #[command(about = "Set a secrets folder")]
21    Set(Set),
22    #[command(about = "Print the current configuration")]
23    Config,
24}
25
26#[derive(Args, Debug, PartialEq)]
27pub struct Project {
28    pub project: Option<String>,
29}
30
31#[derive(Args, Debug, PartialEq)]
32pub struct Set {
33    pub path: PathBuf,
34    pub clipboard: String,
35}