blob: 783cbad5c1d89c2b3c64fe58beaa3891f8970a2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
pub mod core;
pub mod func;
pub mod info;
pub mod preview;
pub mod repo;
pub mod shell;
pub mod temp;
use crate::commands;
use crate::prelude::*;
pub fn handle() -> Result<()> {
use crate::config::Command::*;
match CONFIG.cmd() {
None => commands::core::main(),
Some(c) => match c {
Preview(input) => input.run(),
PreviewVarStdin(input) => input.run(),
PreviewVar(input) => input.run(),
Widget(input) => input.run().context("Failed to print shell widget code"),
Fn(input) => input
.run()
.with_context(|| format!("Failed to execute function `{:#?}`", input.func)),
Info(input) => input
.run()
.with_context(|| format!("Failed to fetch info `{:#?}`", input.info)),
#[cfg(not(feature = "disable-repo-management"))]
Repo(input) => input.run(),
},
}
}
|