Skip to content

Commit

Permalink
feat: ✨ Rename generator to generate
Browse files Browse the repository at this point in the history
  • Loading branch information
AntwortEinesLebens committed Nov 11, 2024
1 parent d7fcf85 commit 36fea66
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: GPL-3.0-or-later

use crate::commands::{generator::Generator, traces::Traces};
use crate::commands::{generate::Generate, traces::Traces};
use clap::{Parser, Subcommand};

#[derive(Parser)]
Expand All @@ -16,5 +16,5 @@ pub struct Arguments {
#[derive(Subcommand)]
pub enum Command {
Traces(Traces),
Generator(Generator),
Generate(Generate),
}
2 changes: 1 addition & 1 deletion src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
//
// SPDX-License-Identifier: GPL-3.0-or-later

pub mod generator;
pub mod generate;
pub mod traces;
6 changes: 3 additions & 3 deletions src/commands/generator.rs → src/commands/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ struct TracesData {
}

#[derive(Parser)]
pub struct Generator {
pub struct Generate {
#[clap(required = true, help = "Path to the configuration file")]
path: PathBuf,
}

impl Generator {
pub fn generate(&self) -> Result<(), Box<dyn Error>> {
impl Generate {
pub fn generate_traces(&self) -> Result<(), Box<dyn Error>> {
if !self.path.try_exists()? || !self.path.is_file() {
return Ok(());
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
match Arguments::parse().command {
Command::Traces(traces) => traces.run()?,
Command::Generator(generator) => generator.generate()?,
Command::Generate(generate) => generate.generate_traces()?,
};

Ok(())
Expand Down

0 comments on commit 36fea66

Please sign in to comment.