Skip to content
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

Merged
merged 3 commits into from
Oct 23, 2020
Merged

Add CLI option to disable image #288

merged 3 commits into from
Oct 23, 2020

Conversation

akrantz01
Copy link
Contributor

Closes #287

Adds the CLI option --off which prevents the image from being displayed.

Copy link
Owner

@o2sh o2sh left a 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 👍

@@ -23,6 +23,7 @@ pub struct Cli {
pub excluded: Vec<String>,
pub print_languages: bool,
pub true_color: bool,
pub image_off: bool,
Copy link
Owner

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

Comment on lines 260 to 262
while let Some(line) = info_lines.next() {
writeln!(f, "{}", line)?;
}
Copy link
Owner

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")
Copy link
Owner

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"])

akrantz01 and others added 2 commits October 22, 2020 15:17
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`.
@o2sh o2sh merged commit 522514d into o2sh:master Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CLI flag to disable ASCII art (or image) and only display info lines
2 participants