Skip to content

Commit

Permalink
Refactor: Refactoring registry.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
allaboutevemirolive committed Oct 8, 2024
1 parent d7c7585 commit cff0c02
Show file tree
Hide file tree
Showing 3 changed files with 364 additions and 207 deletions.
20 changes: 8 additions & 12 deletions src/cli/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,24 @@ impl TreeArgs {
matches: &clap::ArgMatches,
) -> anyhow::Result<()> {
if matches.get_flag(options::meta::META) {
tr.rg.with_permission()?;
tr.rg.with_btime()?;
tr.rg.with_mtime()?;
tr.rg.with_atime()?;
tr.rg.with_size()?;
tr.rg.with_all_metadata();
}

// Individual meta settings
if matches.get_flag(options::meta::PERMISSION) {
tr.rg.with_permission()?;
tr.rg.with_permission();
}
if matches.get_flag(options::meta::BTIME) {
tr.rg.with_btime()?;
tr.rg.with_birth_time();
}
if matches.get_flag(options::meta::MTIME) {
tr.rg.with_mtime()?;
tr.rg.with_modification_time();
}
if matches.get_flag(options::meta::ATIME) {
tr.rg.with_atime()?;
tr.rg.with_access_time();
}
if matches.get_flag(options::meta::SIZE) {
tr.rg.with_size()?;
tr.rg.with_size();
}

Ok(())
Expand All @@ -113,7 +109,7 @@ impl TreeArgs {
matches: &clap::ArgMatches,
) -> anyhow::Result<()> {
if matches.get_flag(options::path::RELATIVE) {
tr.rg.with_relative_path()?;
tr.rg.with_relative_paths();
}
// TODO: Implement absolute path handling
Ok(())
Expand Down Expand Up @@ -142,7 +138,7 @@ impl TreeArgs {
matches: &clap::ArgMatches,
) -> anyhow::Result<()> {
if matches.get_flag(options::color::COLOR) {
tr.rg.with_entry()?;
tr.rg.with_color()?;
}
if matches.get_flag(options::branch::NOBRANCH) {
tr.branch.no_branch();
Expand Down
Loading

0 comments on commit cff0c02

Please sign in to comment.