-
Notifications
You must be signed in to change notification settings - Fork 284
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
Add CLI option to disable image #288
Conversation
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.
Thanks for your PR @akrantz01,
I left a few suggestions 👍
src/onefetch/cli.rs
Outdated
@@ -23,6 +23,7 @@ pub struct Cli { | |||
pub excluded: Vec<String>, | |||
pub print_languages: bool, | |||
pub true_color: bool, | |||
pub image_off: bool, |
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.
As it's not only for images, maybe it would be better to name it art_off
src/onefetch/info.rs
Outdated
while let Some(line) = info_lines.next() { | ||
writeln!(f, "{}", line)?; | ||
} |
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 don't think you need to iterate over info_lines, writeln!(f, "{}\n", buf)?
should be enough
) | ||
.arg( | ||
Arg::with_name("off") | ||
.long("off") |
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.
Maybe we should add .conflicts_with_all(&["image", "ascii-language", "ascii-input"])
Renames `image_off` to `art_off` since it will not only turn of images, removes unnecessary iteration while printing, and defines conflicting CLI arguments for `--off`.
Closes #287
Adds the CLI option
--off
which prevents the image from being displayed.