Skip to content

Commit 482bb3d

Browse files
committed
dev: some code
1 parent 2ac6b31 commit 482bb3d

6 files changed

Lines changed: 199 additions & 67 deletions

File tree

Cargo.lock

Lines changed: 183 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ shellexpand = "3.1"
2626
libloading = "0.8"
2727
thiserror = "2.0.12"
2828
lazy_static = "1.5.0"
29-
once_cell = "1.21.3"
29+
once_cell = "1.21.3"
30+
systemstat = "0.2.3"
31+
chrono = "0.4.41"
32+
chrono-tz = "0.10.4"

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use clap::{Parser, Subcommand};
1+
use clap::{Args, Parser, Subcommand};
22

33
#[derive(Parser)]
44
#[command(name = "monokkai")]

src/core/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
pub mod config;
22
pub mod error;
3-
pub mod plugin;

src/core/plugin.rs

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/main.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@ mod core;
33
mod modules;
44
mod services;
55

6-
use crate::cli::{CliArgs, Commands};
76
use clap::Parser;
7+
use std::error::Error;
88

99
#[tokio::main]
10-
async fn main() {
11-
let args = CliArgs::parse();
10+
async fn main() -> Result<(), Box<dyn Error>> {
11+
let args = cli::CliArgs::parse();
1212

1313
match args.command {
14-
Commands::Git(args) => modules::git::git::handle(args),
15-
Commands::Scan(args) => modules::docker::scan::handle(args),
16-
Commands::Docker(args) => modules::docker::docker::handle(args),
17-
Commands::Auth(args) => services::auth::handle(args),
18-
Commands::Log(args) => modules::git::log::handle(&args),
19-
Commands::Http(args) => {
20-
if let Err(e) = modules::http::handler::handle(args.action).await {
21-
eprintln!("Error: {}", e);
22-
}
23-
}
14+
cli::Commands::Git(args) => modules::git::handle(args),
15+
cli::Commands::Scan(args) => modules::docker::scan::handle(args),
16+
cli::Commands::Docker(args) => modules::docker::handle(args),
17+
cli::Commands::Auth(args) => services::auth::handle(args),
18+
cli::Commands::Log(args) => modules::git::log::handle(&args),
19+
cli::Commands::Http(args) => modules::http::handler::handle(args.action).await?,
2420
}
21+
22+
Ok(())
2523
}

0 commit comments

Comments
 (0)