sharkdp / hexyl

A command-line hex viewer
Apache License 2.0
8.92k stars 227 forks source link

Add unit system (closes #44) #90

Closed ErichDonGubler closed 4 years ago

ErichDonGubler commented 4 years ago

This PR is conceptually similar to @aswild's commits mentioned here, except we attempt to parse units at the first non-ASCII digit, rather than starting from the first ASCII alphabetical. Tests have been shamelessly stolen from those commits.

There are several other housekeeping commits I've added here. If desired, I can split these out into a separate PR.

sharkdp commented 4 years ago

Thank you for your contribution!

See comments in #44

Tests have been shamelessly stolen from those commits.

@aswild: I am assuming that you are okay with this? :smile:

ErichDonGubler commented 4 years ago

I would be more than happy to make @aswild a co-author for the unit system commits -- I've only just learned how to do it on Git, which is why I didn't do so already.

bjorn3 commented 4 years ago

The following my help: https://help.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors

ErichDonGubler commented 4 years ago

The following my help: https://help.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors

Yep, that's what I just learned how to do! :)

ErichDonGubler commented 4 years ago

I've pushed FIXUP changes removing {k,m,g,t} units and the -b alias for --block-size that can should be squashed once the review is complete and @sharkdp wants to merge this -- CC #44.

aswild commented 4 years ago

@aswild: I am assuming that you are okay with this? smile

Yeah I'm cool with that, and don't even need explicit author/contributor credit - the tests were just a basic list of good/bad values I thought of off the top of my head.

ErichDonGubler commented 4 years ago

Yeah I'm cool with that, and don't even need explicit author/contributor credit - the tests were just a basic list of good/bad values I thought of off the top of my head.

You did a (proportionally) significant amount of effort for design, not even taking into account the code you wrote in your own implementation. Your efforts were important, so I'm gonna make you at least a co-author for the commits. 😉

ErichDonGubler commented 4 years ago

@aswild @sharkdp I've resolved the issues that I feel have a conclusive end, just one left for each of you for concerns you've brought up.