-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathmod.rs
More file actions
77 lines (73 loc) · 2.09 KB
/
Copy pathmod.rs
File metadata and controls
77 lines (73 loc) · 2.09 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
use crate::Result;
use clap::Parser;
mod activate;
mod boot;
mod cd;
mod clean;
mod completion;
mod config;
mod disable;
mod enable;
mod list;
pub mod logs;
mod restart;
mod run;
mod start;
mod status;
mod stop;
mod supervisor;
mod tui;
mod usage;
mod wait;
#[derive(Debug, clap::Parser)]
#[clap(name = "pitchfork", version = env!("CARGO_PKG_VERSION"), about = env!("CARGO_PKG_DESCRIPTION"))]
struct Cli {
#[clap(subcommand)]
command: Commands,
}
#[derive(Debug, clap::Subcommand)]
enum Commands {
Activate(activate::Activate),
Boot(boot::Boot),
Cd(cd::Cd),
Clean(clean::Clean),
Config(config::Config),
Completion(completion::Completion),
Disable(disable::Disable),
Enable(enable::Enable),
List(list::List),
Logs(logs::Logs),
Restart(restart::Restart),
Run(run::Run),
Start(start::Start),
Status(status::Status),
Stop(stop::Stop),
Supervisor(supervisor::Supervisor),
Tui(tui::Tui),
Usage(usage::Usage),
Wait(wait::Wait),
}
pub async fn run() -> Result<()> {
let args = Cli::parse();
match args.command {
Commands::Activate(activate) => activate.run().await,
Commands::Boot(boot) => boot.run().await,
Commands::Cd(cd) => cd.run().await,
Commands::Clean(clean) => clean.run().await,
Commands::Config(config) => config.run().await,
Commands::Completion(completion) => completion.run().await,
Commands::Disable(disable) => disable.run().await,
Commands::Enable(enable) => enable.run().await,
Commands::List(list) => list.run().await,
Commands::Logs(logs) => logs.run().await,
Commands::Restart(restart) => restart.run().await,
Commands::Run(run) => run.run().await,
Commands::Start(start) => start.run().await,
Commands::Status(status) => status.run().await,
Commands::Stop(stop) => stop.run().await,
Commands::Supervisor(supervisor) => supervisor.run().await,
Commands::Tui(tui) => tui.run().await,
Commands::Usage(usage) => usage.run().await,
Commands::Wait(wait) => wait.run().await,
}
}