serenity
serenity copied to clipboard
cat: Add -b to number non-blank lines
This PR adds a -b option to the cat command to number non-blank lines:
This is one of two implementations I came up with. It diverges from the existing approach of determining when to print a line number and opts for a more explicit state machine-based approach.
The other PR more closely resembles and extends the existing approach https://github.com/SerenityOS/serenity/pull/24917
I personally think this approach easier to understand than trying to extend the existing approach.
Hello!
One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.
@PerrinJS do you have thoughts on this approach versus https://github.com/SerenityOS/serenity/pull/24917?
@nico would you be willing to take a look? I see you helped review the cat -n PR https://github.com/SerenityOS/serenity/pull/24382
I like the approach, and it looks good. However, adding the -n was my first commit to this project, so I'm not fully sure about working as a reviewer when I don't know all the rules of the project. Especially when it comes to how adding test units is suposed to be done.
@nico would you be willing to take a look? I see you helped review the
cat -nPR #24382
CI is currently red. Can you get that sorted out before asking for reviews?
Fixed the CI check. PR is ready for review
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!