pace_rs/commands/
adjust.rs

1//! `adjust` subcommand
2
3use abscissa_core::{status_err, Application, Command, Runnable, Shutdown};
4use clap::Parser;
5
6use crate::prelude::PACE_APP;
7
8use pace_core::prelude::AdjustCommandOptions;
9
10/// `adjust` subcommand
11#[derive(Command, Debug, Parser)]
12pub struct AdjustCmd {
13    #[clap(flatten)]
14    adjust_opts: AdjustCommandOptions,
15}
16
17impl Runnable for AdjustCmd {
18    fn run(&self) {
19        match self.adjust_opts.handle_adjust(&PACE_APP.config()) {
20            Ok(user_message) => user_message.display(),
21            Err(err) => {
22                status_err!("{}", err);
23                PACE_APP.shutdown(Shutdown::Crash);
24            }
25        };
26    }
27}