1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//! `begin` subcommand

use abscissa_core::{status_err, Application, Command, Runnable, Shutdown};
use clap::Parser;

use crate::prelude::PACE_APP;

use pace_core::BeginCommandOptions;

/// `begin` subcommand
#[derive(Command, Debug, Parser)]
pub struct BeginCmd {
    #[clap(flatten)]
    begin_opts: BeginCommandOptions,
}

impl Runnable for BeginCmd {
    fn run(&self) {
        if let Err(err) = self.begin_opts.handle_begin(&PACE_APP.config()) {
            status_err!("{}", err);
            PACE_APP.shutdown(Shutdown::Crash);
        };
    }
}