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

Seq: Add --terminator flag #150

Merged
merged 2 commits into from
Oct 5, 2021
Merged

Conversation

reastyn
Copy link
Contributor

@reastyn reastyn commented Oct 3, 2021

Issue #63

Copy link
Owner

@GrayJack GrayJack 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 contributing!! 🎉

I leave some comments for you.

The format check is failing, but don't worry, if you're unable to use nightly compiler to format the code (sadly our config still requires some unstable rustfmt features), after you apply the final changes to solve my comments I'll format the code before merging

seq/src/cli.rs Outdated
Arg::with_name("TERMINATOR")
.short("t")
.long("terminator")
.help("Terminator of the values")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed a dot at the end of the string

seq/src/main.rs Outdated
let valid_range = (first <= last && inc > 0.0) || (first >= last && inc < 0.0);
if valid_range {
let seq = Seq::new(first, inc, last, decimals, separator, padding);
for val in seq.into_iter() {
print!("{}", val);
}
println!();
print!("\n{}", terminator);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're print a newline before printing the terminator. If I remember correctly (almost 2 years since I had used FreeBSD seq), the behavior would to just print the terminator

@reastyn
Copy link
Contributor Author

reastyn commented Oct 4, 2021

Hey, I pushed another version, would you please take a look at it? I tried to format it with rust fmt. Thank you!

@GrayJack
Copy link
Owner

GrayJack commented Oct 5, 2021

bors r+

@bors bors bot merged commit d26898f into GrayJack:dev Oct 5, 2021
@reastyn
Copy link
Contributor Author

reastyn commented Oct 5, 2021

Awesome, would you please put the hacktoberfest-accepted to this pull request? Thank you!

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.

2 participants