tag2upload_service_manager/
cli_common.rs

1//! Command-line handling code present even in tests (ie, when mocking)
2
3use crate::prelude::*;
4
5#[derive(Debug)]
6pub struct WholeConfig {
7    pub cli_options: CliOptions,
8    pub config: Config,
9    pub computed_config: ComputedConfig,
10    pub rocket_config: figment::Figment,
11}
12
13#[derive(Debug, clap::Parser)]
14#[command(after_help = format!(
15r#"tag2upload-service-manager ({})
16Copyright Ian Jackson, Sean Whitton and contributors to tag2upload.
17This is Free Software with NO WARRANTY.  GPL-3.0-or-later.
18"#, crate::version::raw_info()))]
19pub struct CliOptions {
20    #[arg(short, long)]
21    pub config: Vec<String>,
22
23    #[arg(short = 'C', long)]
24    pub config_toml: Vec<String>,
25
26    #[command(subcommand)]
27    pub op: CliOperation,
28}
29
30#[derive(Debug, Clone, clap::Subcommand)]
31pub enum CliOperation {
32    RunManager {},
33    CheckConfig {},
34    CheckConfigSyntax {},
35    PrintDatabaseSchema {},
36}