numfmt: implement missing options
Currently these options available in GNU numfmt are still missing:
- [ ] --debug
- [x] -d/--delimiter
- [x] --field
- [ ] --from-unit
- [ ] --grouping
- [ ] --invalid
- [x] --round
- [x] --suffix
- [ ] -z/--zero-terminated
I'll be implementing them as much as I can.
Is it okay for me to have a go at few of these? (currently thinking of --field/-d)
Fine if you want to do it of course :)
Yes you can work on that.
Jamie [email protected] 于 2018年9月24日周一 08:27写道:
Is it okay for me to have a go at few of these? (currently thinking of --field/-d)
Fine if you want to do it of course :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/uutils/coreutils/issues/1280#issuecomment-423957426, or mute the thread https://github.com/notifications/unsubscribe-auth/AD4QkXKXMJFT1WhIyO9sGSQIeoBCJK4Oks5ueM_IgaJpZM4WMwnF .
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Looks like -d, --field, and --round have been implemented:
$ ./target/debug/coreutils numfmt --help
[...]
OPTIONS:
-d, --delimiter <X> use X instead of whitespace for field delimiter
--field <FIELDS> replace the numbers in these input fields (default=1) see FIELDS below [default: 1]
--from <UNIT> auto-scale input numbers to UNITs; see UNIT below [default: none]
--header <N> print (without converting) the first N header lines; N defaults to 1 if not specified
--padding <N> pad the output to N characters; positive N will right-align; negative N will left-align; padding is ignored if the output is wider than N; the default is to automatically pad
if a whitespace is found
--round <METHOD> use METHOD for rounding when scaling; METHOD can be: up,down, from-zero (default), towards-zero, nearest [default: from-zero] [possible values: up, down, from-zero, towards-
zero, nearest]
--to <UNIT> auto-scale output numbers to UNITs; see UNIT below [default: none]
I've implemented suffix now, which solved 18 of the GNU numfmt tests. Might have a look at --invalid next :)
@sbentmar , thanks for the contribution!
I can't find the test changes; the total GNU test summary reports "GNU tests summary = TOTAL: 601 / PASS: 199 / FAIL: 295 / ERROR: 23", unchanged from 'master'. Am I missing the test change somewhere else?
@rivy probably because the .sh test from gnu isn't fulling passing.
Sorry for the confusion, 18 more of the ~400 numfmt Perl test cases are passing now. I suspect that the entire numfmt.pl test suite counts as a single test in the complete summary, so all the 400 tests need to pass for it to count. There are still 171 failing test cases, in that case :)
Sorry for the confusion, 18 more of the ~400 numfmt Perl test cases are passing now. I suspect that the entire numfmt.pl test suite counts as a single test in the complete summary, so all the 400 tests need to pass for it to count. There are still 171 failing test cases, in that case :)
Ah, thanks for the clarification.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.