Skip to content

Commit

Permalink
feat: ✨ Rename actions to traces
Browse files Browse the repository at this point in the history
  • Loading branch information
AntwortEinesLebens committed Nov 3, 2024
1 parent 0b9c800 commit da375d3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 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::actions::Actions;
use crate::traces::Traces;
use clap::{Parser, Subcommand};

#[derive(Debug, Parser)]
Expand All @@ -15,5 +15,5 @@ pub struct Arguments {

#[derive(Debug, Subcommand)]
pub enum Commands {
Actions(Actions),
Traces(Traces),
}
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
//
// SPDX-License-Identifier: GPL-3.0-or-later

mod actions;
mod cli;
mod traces;
mod windows;

use actions::Runnable;
use clap::Parser;
use cli::{Arguments, Commands};
use std::error::Error;
use traces::Runnable;

fn banner() {
let banner: &str = "
Expand All @@ -28,7 +28,7 @@ fn main() -> Result<(), Box<dyn Error>> {
banner();

match Arguments::parse().command {
Commands::Actions(action) => action.run()?,
Commands::Traces(action) => action.run()?,
};

Ok(())
Expand Down
6 changes: 3 additions & 3 deletions src/actions.rs → src/traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
//
// SPDX-License-Identifier: GPL-3.0-or-later

use crate::actions::{drivers::Drivers, processes::Processes};
use crate::traces::{drivers::Drivers, processes::Processes};
use clap::{Args, Subcommand};
use std::error::Error;

pub mod drivers;
pub mod processes;

#[derive(Debug, Args)]
pub struct Actions {
pub struct Traces {
#[clap(subcommand)]
pub command: Commands,
}
Expand All @@ -25,7 +25,7 @@ pub trait Runnable {
fn run(&self) -> Result<(), Box<dyn Error>>;
}

impl Runnable for Actions {
impl Runnable for Traces {
fn run(&self) -> Result<(), Box<dyn Error>> {
match &self.command {
Commands::Drivers(drivers) => drivers as &dyn Runnable,
Expand Down
2 changes: 1 addition & 1 deletion src/actions/drivers.rs → src/traces/drivers.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::actions::{drivers::byovd::Byovd, Runnable};
use crate::traces::{drivers::byovd::Byovd, Runnable};
use clap::{Args, Subcommand};
use std::error::Error;

Expand Down
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::{actions::Runnable, windows::users::is_administrator};
use crate::{traces::Runnable, windows::users::is_administrator};
use clap::Parser;
use std::{error::Error, path::PathBuf};
use windows::{
Expand Down
2 changes: 1 addition & 1 deletion src/actions/processes.rs → src/traces/processes.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::actions::{processes::spoofing::Spoofing, Runnable};
use crate::traces::{processes::spoofing::Spoofing, Runnable};
use clap::{Args, Subcommand};
use std::error::Error;

Expand Down
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::{actions::Runnable, windows::processes::get_pid};
use crate::{traces::Runnable, windows::processes::get_pid};
use clap::Parser;
use std::{
error::Error, ffi::OsString, iter::once, mem::size_of, os::windows::ffi::OsStrExt,
Expand Down

0 comments on commit da375d3

Please sign in to comment.