1
//! # mk-cli
2
//!
3
//! `mk-cli` is a command line interface for the `mk` library.
4
use cli_entry::CliEntry;
5
use mk_lib::schema::ExecutionInterrupted;
6

            
7
/// The entry point for the CLI
8
mod cli_entry;
9

            
10
/// The struct that represents the stored secrets
11
mod secrets;
12

            
13
/// Fuzzy task selector helpers
14
mod task_selector;
15

            
16
/// The main function
17
53
fn main() -> anyhow::Result<()> {
18
53
  match run() {
19
34
    Ok(()) => Ok(()),
20
19
    Err(error) if error.downcast_ref::<ExecutionInterrupted>().is_some() => {
21
      std::process::exit(130);
22
    },
23
19
    Err(error) => Err(error),
24
  }
25
53
}
26

            
27
53
fn run() -> anyhow::Result<()> {
28
53
  if CliEntry::maybe_print_task_completion_from_env()? {
29
    return Ok(());
30
53
  }
31

            
32
53
  let cli = CliEntry::new()?;
33
51
  cli.run()
34
53
}