Skip to content

Commit

Permalink
rust: rename commands to cli
Browse files Browse the repository at this point in the history
The commands module is the parent module for all CLI commands.

Commands matches to closely with the command pattern.
  • Loading branch information
jasonish committed Jun 13, 2024
1 parent 84a16fe commit 0758640
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions src/bin/evebox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,11 @@ async fn evebox_main() -> Result<(), Box<dyn std::error::Error>> {
let mut parser = parser
.subcommand(server)
.subcommand(oneshot)
.subcommand(evebox::commands::agent::command())
.subcommand(evebox::commands::config::config_subcommand())
.subcommand(evebox::commands::print::command())
.subcommand(evebox::commands::elastic::main::main_options())
.subcommand(evebox::commands::sqlite::command());
.subcommand(evebox::cli::agent::command())
.subcommand(evebox::cli::config::config_subcommand())
.subcommand(evebox::cli::print::command())
.subcommand(evebox::cli::elastic::main::main_options())
.subcommand(evebox::cli::sqlite::command());
let matches = parser.clone().get_matches();

// Initialize logging.
Expand All @@ -322,12 +322,12 @@ async fn evebox_main() -> Result<(), Box<dyn std::error::Error>> {
version::print_version();
Ok(())
}
Some(("oneshot", args)) => evebox::commands::oneshot::main(args).await,
Some(("agent", args)) => evebox::commands::agent::main(args).await,
Some(("config", args)) => evebox::commands::config::main(args).await,
Some(("print", args)) => evebox::commands::print::main(args),
Some(("elastic", args)) => evebox::commands::elastic::main::main(args).await,
Some(("sqlite", args)) => evebox::commands::sqlite::main(args).await,
Some(("oneshot", args)) => evebox::cli::oneshot::main(args).await,
Some(("agent", args)) => evebox::cli::agent::main(args).await,
Some(("config", args)) => evebox::cli::config::main(args).await,
Some(("print", args)) => evebox::cli::print::main(args),
Some(("elastic", args)) => evebox::cli::elastic::main::main(args).await,
Some(("sqlite", args)) => evebox::cli::sqlite::main(args).await,
_ => {
parser.print_help().ok();
println!();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/commands/elastic/main.rs → src/cli/elastic/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: (C) 2022 Jason Ish <jason@codemonkey.net>
// SPDX-License-Identifier: MIT

use crate::commands::elastic::info;
use crate::cli::elastic::info;
use clap::{Command, CommandFactory, FromArgMatches, Parser, Subcommand};

use super::set_field_limit;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub mod logger;
pub mod agent;
pub mod bookmark;
pub(crate) mod cert;
pub mod commands;
pub mod cli;
pub mod config;
pub(crate) mod datetime;
mod elastic;
Expand Down

0 comments on commit 0758640

Please sign in to comment.