-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ignore flag for ignoring directories #102
base: main
Are you sure you want to change the base?
Conversation
ed6d1c5
to
03939b1
Compare
@@ -103,6 +112,7 @@ pub fn start<B>( | |||
terminal_backend: B, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the start
function takes a growing list of parameters for various options and flags (e.g., show_apparent_size
, disable_delete_confirmation
). As we continue to add more options, this signature risks becoming unwieldy and harder to maintain. The challenge became especially apparent when updating the UI tests, which required significant changes due to the expanded parameter list.
To address this, I’ve started a WIP implementation that uses the Opt
struct as the last argument in start
. This encapsulates all optional parameters into a single structure, aiming to reduce churn when adding or modifying options.
I’d appreciate input on the following:
- Is encapsulating options in a configuration struct like
Opt
an idiomatic approach in Rust? - Would a builder pattern provide better flexibility and maintainability for this use case?
- Are there other patterns or techniques in Rust that would align well with the goal of minimizing signature changes?
I’m especially interested in feedback on how this impacts code readability, maintainability, and idiomatic usage in Rust.
@@ -53,6 +53,9 @@ pub struct Opt { | |||
/// The folder to scan | |||
folder: Option<PathBuf>, | |||
#[structopt(short, long)] | |||
/// The directories to ignore | |||
ignore: Vec<PathBuf>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have opted to use an ignore
option but wondering if we would prefer to use exclude
with shorthand x
, I have seen that preference voiced in other issues.
ignore
flag to optionally ignore directories from being scannedResolves #93