-
-
Notifications
You must be signed in to change notification settings - Fork 40
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: Implement with support for -sw #125
Conversation
f6a9aec
to
e24ffbc
Compare
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 contribution!! 😄
Besides these comments, could you add seq to all workspace toml files so the CI can check all for all platforms possible?
seq/Cargo.toml
Outdated
build = "build.rs" | ||
edition = "2018" | ||
description = """ | ||
Print numbers from FIRST to LAST, in steps of INCREMENT. |
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.
Can you use the word "display" instead?
seq/src/cli.rs
Outdated
.version_message("Display version information.") | ||
.help_short("?") | ||
.settings(&[ColoredHelp]) | ||
.arg(Arg::with_name("FIRST INCREMENT LAST").multiple(true)) |
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.
This arg is required, isn't it?
seq/src/cli.rs
Outdated
Arg::with_name("SEPERATOR") | ||
.short("s") | ||
.long("separator") | ||
.help("use STRING to separate numbers (default: \\n)") |
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 think the default text would be better with square bracket to be similar to the normal default text that clap uses
seq/src/main.rs
Outdated
fn max_decimal_digits(args: &[&str]) -> usize { | ||
args.iter().map(|v| v.len() - v.find(".").map(|pos| pos + 1).unwrap_or(v.len())).max().unwrap() | ||
} | ||
|
||
fn max_digits(args: &[&str]) -> usize { | ||
args.iter().map(|v| v.find(".").unwrap_or(v.len())).max().unwrap() | ||
} |
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.
Are this unwrap never fail? If they never fail, can you add comments for why it don't fail? If they can fail, it should pass the information forward or be handled on the site
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.
That's right, it should never fail. I add a comment to make it explicit.
@GrayJack all toml files updated, thanks! |
Seems good bors r+ |
@GrayJack |
Yes, probably is the best thing to do, I was just lazy these days |
Initial implementation, no support for "-f" yet.