Skip to content

Commit c9407ec

Browse files
committed
prep engine command
1 parent 68df4f2 commit c9407ec

21 files changed

+333
-138
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ chrono = "0.4.41"
5252
compact_str = {version="0.9.0", git="https://github.com/TeamDman/compact_str", branch="mine", features=["bevy-reflect"]}
5353
teamy-windows = "0.2.0"
5454
bevy = "0.17.0-rc.1"
55-
range-set = "0.1.0"
5655

5756
[dev-dependencies]
5857
tempfile = "3.20"

src/bevy/main.rs

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

src/bevy/mod.rs

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

src/bevy/sync_dir.rs

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

src/cli/command/check.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::cli::to_args::ToArgs;
12
use crate::drive_letter_pattern::DriveLetterPattern;
23
use crate::mft_check::check_drives;
34
use arbitrary::Arbitrary;
@@ -16,4 +17,4 @@ impl CheckArgs {
1617
}
1718
}
1819

19-
impl crate::cli::to_args::ToArgs for CheckArgs {}
20+
impl ToArgs for CheckArgs {}

src/cli/command/engine.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
use crate::cli::to_args::ToArgs;
2+
use arbitrary::Arbitrary;
3+
use clap::Args;
4+
use clap::Subcommand;
5+
6+
#[derive(Args, Arbitrary, PartialEq, Debug)]
7+
pub struct EngineArgs {
8+
#[clap(subcommand)]
9+
pub command: EngineCommand,
10+
}
11+
12+
#[derive(Subcommand, Arbitrary, PartialEq, Debug)]
13+
pub enum EngineCommand {
14+
Run,
15+
}
16+
17+
impl EngineArgs {
18+
pub fn invoke(self) -> eyre::Result<()> {
19+
match self.command {
20+
EngineCommand::Run => {
21+
println!("Engine command is a work in progress.");
22+
Ok(())
23+
}
24+
}
25+
}
26+
}
27+
28+
impl ToArgs for EngineArgs {
29+
fn to_args(&self) -> Vec<std::ffi::OsString> {
30+
match &self.command {
31+
EngineCommand::Run => vec!["run".into()],
32+
}
33+
}
34+
}

src/cli/command/get_sync_dir.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use arbitrary::Arbitrary;
22
use clap::Args;
33

4+
use crate::cli::to_args::ToArgs;
5+
46
#[derive(Args, Arbitrary, PartialEq, Debug, Default)]
57
pub struct GetSyncDirArgs;
68

@@ -14,4 +16,4 @@ impl GetSyncDirArgs {
1416
}
1517
}
1618

17-
impl crate::cli::to_args::ToArgs for GetSyncDirArgs {}
19+
impl ToArgs for GetSyncDirArgs {}

src/cli/command/list_paths.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::cli::to_args::ToArgs;
12
use crate::drive_letter_pattern::DriveLetterPattern;
23
use crate::mft::mft_file::MftFile;
34
use crate::sync_dir::try_get_sync_dir;
@@ -160,7 +161,7 @@ impl ListPathsArgs {
160161
}
161162
}
162163

163-
impl crate::cli::to_args::ToArgs for ListPathsArgs {
164+
impl ToArgs for ListPathsArgs {
164165
fn to_args(&self) -> Vec<std::ffi::OsString> {
165166
let mut args = Vec::new();
166167
// drive_pattern is a positional argument with a default of "*".

src/cli/command/mod.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ pub mod list_paths;
44
pub mod query;
55
pub mod robocopy_logs_tui;
66
pub mod set_sync_dir;
7-
pub mod sync; // added
7+
pub mod sync;
8+
pub mod engine;
89

910
use crate::cli::command::check::CheckArgs;
11+
use crate::cli::command::engine::EngineArgs;
1012
use crate::cli::command::get_sync_dir::GetSyncDirArgs;
1113
use crate::cli::command::list_paths::ListPathsArgs;
12-
use crate::cli::command::query::QueryArgs; // added
14+
use crate::cli::command::query::QueryArgs;
1315
use crate::cli::command::robocopy_logs_tui::RobocopyLogsTuiArgs;
1416
use crate::cli::command::set_sync_dir::SetSyncDirArgs;
1517
use crate::cli::command::sync::SyncArgs;
@@ -32,9 +34,11 @@ pub enum Command {
3234
/// Validate cached MFT files have at least one Win32 FILE_NAME attribute per entry having any FILE_NAME
3335
Check(CheckArgs),
3436
/// Query resolved file paths (substring match) across cached MFTs
35-
Query(QueryArgs), // added
37+
Query(QueryArgs),
3638
/// Explore robocopy logs in a TUI (validate file exists for now)
3739
RobocopyLogsTui(RobocopyLogsTuiArgs),
40+
/// Run the Bevy game engine to visualize MFT data processing
41+
Engine(EngineArgs),
3842
}
3943

4044
impl Default for Command {
@@ -51,8 +55,9 @@ impl Command {
5155
Command::GetSyncDir(args) => args.invoke(),
5256
Command::SetSyncDir(args) => args.invoke(),
5357
Command::Check(args) => args.invoke(),
54-
Command::Query(args) => args.invoke(), // added
58+
Command::Query(args) => args.invoke(),
5559
Command::RobocopyLogsTui(args) => args.invoke(),
60+
Command::Engine(args) => args.invoke(),
5661
}
5762
}
5863
}
@@ -89,6 +94,10 @@ impl ToArgs for Command {
8994
args.push("robocopy-logs-tui".into());
9095
args.extend(logs_args.to_args());
9196
}
97+
Command::Engine(engine_args) => {
98+
args.push("engine".into());
99+
args.extend(engine_args.to_args());
100+
}
92101
}
93102
args
94103
}

0 commit comments

Comments
 (0)