pace_rs/commands/settings/
get.rs1use abscissa_core::{Application, Command, Runnable};
2use clap::{Parser, Subcommand};
3
4use crate::prelude::PACE_APP;
5
6#[derive(Subcommand, Command, Debug, Runnable)]
8pub enum GetChoiceSubCmd {
9 #[clap(visible_alias = "tz")]
11 Timezone(GetTimezoneSubCmd),
12}
13
14#[derive(Command, Debug, Parser, Runnable)]
16pub struct GetChoiceCmd {
17 #[clap(subcommand)]
18 commands: GetChoiceSubCmd,
19}
20
21#[derive(Command, Debug, Parser)]
23pub struct GetTimezoneSubCmd {}
24
25impl Runnable for GetTimezoneSubCmd {
26 fn run(&self) {
27 if let Some(time_zone) = PACE_APP.config().general().default_time_zone().as_ref() {
28 println!("{}", time_zone);
29 } else {
30 println!("No time zone set.");
31 };
32 }
33}