Commit graph

3552 commits

Author SHA1 Message Date
Sylvestre Ledru
d0890b72cd
Merge pull request #1522 from sylvestre/groups
groups: clap migration
2020-06-08 22:19:08 +02:00
Sylvestre Ledru
851e25d134 refactor(logname): simplify the code 2020-06-07 17:54:30 +02:00
Sylvestre Ledru
5963b15746 refactor(nproc): fix some bugs and use clap 2020-06-02 23:29:21 +02:00
Sylvestre Ledru
ed1ebe09ff refactor(groups): move to clap 2020-06-02 23:16:18 +02:00
Sylvestre Ledru
78c04a254e refactor ~ rename MinSRV => MinRustV 2020-06-02 12:23:48 -05:00
Roy Ivy III
fbbd881ca9 docs ~ reduce sub-crate meta-information keywords to the maximum of five 2020-05-31 15:48:54 -05:00
Roy Ivy III
b2a566d50d fix/mknod ~ correct uucore feature dependency 2020-05-30 02:21:05 -05:00
Roy Ivy III
2fd7e15d63 fix/install ~ correct uucore feature dependency 2020-05-30 02:21:05 -05:00
Roy Ivy III
4b0dd73adb fix/chmod ~ correct uucore feature dependency 2020-05-30 02:21:05 -05:00
Roy Ivy III
923c47a408 refactor ~ remove outdated clippy attributes 2020-05-30 01:36:02 -05:00
Roy Ivy III
fb5ab86aee refactor help text and variable names 2020-05-30 01:36:02 -05:00
Roy Ivy III
8cf58de0a7 docs ~ polish/update comments 2020-05-30 01:36:02 -05:00
Roy Ivy III
619d0ab72b docs ~ add markdown-lint directives 2020-05-30 01:36:02 -05:00
Roy Ivy III
f82de13847 docs ~ spell-check repairs and addition of exceptions 2020-05-30 01:36:02 -05:00
Roy Ivy III
38ebc14b29 maint/build ~ remove .gitignore from sub-crate 'cut' 2020-05-29 22:59:48 -05:00
Roy Ivy III
21a4da905f fix cargo clippy complaint (single_component_path_imports) 2020-05-29 22:59:48 -05:00
Roy Ivy III
ea3235c7e2 change ~ new_coreopts!() => app!() (from uucore v0.0.4) 2020-05-29 22:59:48 -05:00
Roy Ivy III
4b8fc7445b change ~ disp_err!() => show_usage_error!() (from uucore v0.0.4) 2020-05-29 22:59:48 -05:00
Roy Ivy III
6f465eeb9f deps ~ update utils to uucore/uucore_procs v0.0.4 2020-05-29 22:59:48 -05:00
Roy Ivy III
e3fd15e73c fix cargo clippy complaint (single_component_path_imports) 2020-05-29 22:59:48 -05:00
Roy Ivy III
156031b929 fix/sync ~ update to correct current WinAPI usage (ref #1496) 2020-05-29 22:59:48 -05:00
Roy Ivy III
fc9abdc179 fix/tail ~ update to correct current WinAPI usage (ref #1496) 2020-05-29 22:59:48 -05:00
Roy Ivy III
64f888d364 fix/cp ~ update to correct current WinAPI usage (ref #1496) 2020-05-29 22:59:48 -05:00
Roy Ivy III
251905da3d fix/du ~ update to correct WinAPI usage (fixes #1496) 2020-05-29 22:59:47 -05:00
Roy Ivy III
131bca3d53 fix/split ~ fix 'edition=2018' trait specification error 2020-05-29 22:59:47 -05:00
Roy Ivy III
3129c8fbe5 fix/od ~ fix 'edition=2018' trait specification error 2020-05-29 22:59:47 -05:00
Roy Ivy III
d4aa3a2231 fix 'edition="2018"' module import errors
- ref: <https://users.rust-lang.org/t/imports-can-only-refer-to-extern-crate-names/24388> @@ <https://archive.is/iCaXp>
2020-05-29 22:59:47 -05:00
Roy Ivy III
d70db1f7d2 docs ~ improve/update sub-crate meta information 2020-05-29 22:59:47 -05:00
Roy Ivy III
45a1609a38 update held/pinned dependencies (to maintain MinSRV v1.31.0) 2020-05-29 22:59:47 -05:00
Roy Ivy III
7cfa8be5f2 docs ~ add meta information to sub-crates 2020-05-29 22:59:47 -05:00
Roy Ivy III
6cb609aeee docs/codespell ~ fix spelling errors 2020-05-29 22:59:47 -05:00
Roy Ivy III
db2e950918 change ~ make all sub-crates independent 2020-05-29 22:59:40 -05:00
Roy Ivy III
6606408ce9 refactor/polish ~ whitespace normalization (consistent indentation [either tabs *or* spaces], EOF EOLNs, no trailing whitespace) 2020-05-24 17:29:07 -05:00
Roy Ivy III
09abcf8cbe
Merge pull request #1525 from nbraud/factor/faster
Performance improvements for `factor`
2020-05-24 16:54:04 -05:00
Nicolas Braud-Santoni
4c3682aec7
factor::Factors::add: Split up to work without NLL
Co-authored-by: Roy Ivy III <rivy.dev@gmail.com>
2020-05-24 19:14:37 +02:00
nicoo
36a2948959 factor::miller_rabin: Avoid unecessary exponentiation
Instead of computing a^r and a^(n-1) = a^(r 2ⁱ) separately,
compute the latter by repeatedly squaring the former.

33.6% performance improvement
2020-05-24 19:10:34 +02:00
nicoo
543c7b941a factor::rho: Small refactor 2020-05-24 19:10:29 +02:00
nicoo
30fd6a0309 factor::numeric: Replace lose functions with an Arithmetic trait 2020-05-24 18:16:21 +02:00
nicoo
29eb8fd77b format: Make clippy happy 2020-05-24 17:06:19 +02:00
nicoo
8241037690 factor::miller_rabin: Extract dividers from the primality test
Another 36% improvement.
2020-05-24 15:41:23 +02:00
nicoo
6b9585b1dc factor::miller_rabbin: Refactor before extracting dividers
Replace iterated division with u64::trailing_zeros, hoist the selection of `mul`
out of the loop, another cool 49.5% runtime improvement.
2020-05-24 15:41:23 +02:00
nicoo
e3ecc81d97 factor: Move the Miller-Rabin primality test to its own module. 2020-05-24 15:41:23 +02:00
nicoo
74054feb94 factor::factor: Remove extraneous call to the primality test
Another 6.97% runtime improvement
2020-05-24 15:41:23 +02:00
nicoo
e1a6dbe619 factor::table: Remove obsolete, commented code 2020-05-24 15:41:23 +02:00
nicoo
169740629b factor::table: Remove extraneous calls to the primality test
50% performance improvement on factoring all numbers between 2 and 10⁶.
2020-05-24 15:41:23 +02:00
nicoo
418fd61759 factor::factor: Short-circuit the fallback to Pollard's rho
When the remainder is smaller than the max. entry in the table,
it is guaranteed to be prime.
2020-05-24 15:41:23 +02:00
nicoo
bc11e57962 factor::factor: Use u64::trailing_zero instead of iterated division
No significant performance impact (most of the time is spent elsewhere),
but an easy and satisfying fix nevertheless.
2020-05-24 15:41:23 +02:00
nicoo
a1b2522750 factor: Move each factorisation method to its own module
Also decoupled the factorisation methods; now factor::factor contains
the logic that chains the different algorithms and aggregates results.

As a side-effect, rho::factor now performs extraneous allocations (as each
recursive step creates a new `Factors` value, which is then aggregated into
the previous one) but there is no significant performance impact.
2020-05-24 15:41:23 +02:00
nicoo
d9095a2539 factor: Refactor (eheh) around a Factors datatype
It is clearer to see what is going on, as opposed to passing around an
unmarked `Vec<u64>`, and there is a single place to add invariants checks.

This is also a more compact memory representation: each prime factor is
represented only once, with an additional byte for multiplicity.  The
performance impact is however not significant.
2020-05-24 15:41:23 +02:00
Sylvestre Ledru
75b7f768ea
fix(mv): Allow move across file systems (#1524)
Co-authored-by: Arni Dagur <arni@dagur.eu>
2020-05-24 12:49:56 +02:00
Sylvestre Ledru
272b66aac8
refactor(hostname): use clap instead of getopts for consistency (#1516)
* refactor(hostname): use clap instead of getopts for consistency

* deps ~ uucore/wide is required

Co-authored-by: Roy Ivy III <rivy.dev@gmail.com>
2020-05-22 17:27:03 +02:00
Sylvestre Ledru
817a237821
Merge pull request #1513 from sylvestre/uptime-since
feature(uptime): add option --since
2020-05-21 22:18:52 +02:00
Sylvestre Ledru
2fe2fe7275
be less prescriptive with clap versions (#1514) 2020-05-21 22:18:13 +02:00
Sylvestre Ledru
0a02aeda71
refactor(hostname): rely on the hostname crate (#1517) 2020-05-21 10:58:38 +02:00
Sylvestre Ledru
3994af5678
Update src/uu/uptime/src/uptime.rs
Co-authored-by: Roy Ivy III <rivy.dev@gmail.com>
2020-05-21 10:58:23 +02:00
Sylvestre Ledru
340b5badda
Update src/uu/uptime/src/uptime.rs
Co-authored-by: Roy Ivy III <rivy.dev@gmail.com>
2020-05-21 10:58:15 +02:00
Sylvestre Ledru
6bc9b38fa9 fix(cp): Remove an unused dep to the getops crate 2020-05-17 12:09:55 +02:00
Sylvestre Ledru
719f2bf8ae feature(uptime): add option --since
For this, I:
* moved from getops to clap
* remove the millisecond maths
2020-05-17 11:50:08 +02:00
Roy Ivy III
8e886c30dc
Merge pull request #1511 from sylvestre/more
fix(more) handle no arguments without panic; add test and a FixME
2020-05-15 19:17:01 -05:00
Sylvestre Ledru
80203a7a02 fix(more) Return a proper error message when no argument is provided
Fix #1509
2020-05-15 17:48:35 -05:00
Roy Ivy III
9052bc4de7
Merge pull request #1503 from sylvestre/arch
test(arch): add tests and description text
2020-05-10 20:11:10 -05:00
Anuvrat Parashar
ce064dc62e feature(head): Introduce NLines to handle negative lines parameters 2020-05-10 21:32:48 +02:00
Sylvestre Ledru
1565f4d1d9
Update src/uu/arch/src/arch.rs
Co-authored-by: Roy Ivy III <rivy.dev@gmail.com>
2020-05-10 21:05:38 +02:00
Roy Ivy III
6e77f99f61
Merge pull request #1507 from sylvestre/id
add/id ~ long option variant and tests
2020-05-10 12:21:07 -05:00
Sylvestre Ledru
a83fe2f098
Merge pull request #1508 from muskuloes/master
Flush output buffer for expand/unexpand commands
2020-05-09 21:17:58 +02:00
muskuloes
c84f89257e fix clippy warning: extract function 2020-05-09 19:28:13 +02:00
muskuloes
b4752e079f flush output of unexpand command as well 2020-05-09 19:28:13 +02:00
muskuloes
fb8f3ebf96 expand: flush output buffer 2020-05-09 19:28:13 +02:00
Sylvestre Ledru
91ac5343db
remove artifact 2020-05-09 10:23:03 +02:00
Sylvestre Ledru
9fb00df9b3 test(id): add tests for id 2020-05-09 00:14:10 +02:00
Sylvestre Ledru
90dfa70bd3 feature(id): add --user, --group & --groups 2020-05-09 00:07:04 +02:00
Sylvestre Ledru
437e3aeab7 style(sort): Fix a clippy warning 2020-05-07 23:13:11 +02:00
elgris
71ba8b3fd6 sort: add "dictionary-order" flag.
The flag makes 'sort' command ignore non-dictionary symbols
(non-alphanumeric and non-spaces). The only difference with GNU sort is
that it takes ALL alphanumeric symbols, not only ASCII ones.
2020-05-07 23:08:24 +02:00
Sylvestre Ledru
f44e5465b8 cleanup(yes, whoami): remove some old workaround to force cargo rebuilds 2020-05-06 23:39:49 +02:00
Sylvestre Ledru
16bf4b1893 test(arch): Add some tests 2020-05-06 00:39:13 +02:00
E5ten
2a61fc7f72 feature(uname): Add -o/--operating-system flag
The code for the flag already existed it had just not been added to the argument parsing. Replace "print the operating system name." in -s help text with "print the kernel name." so the -o option can use the previous -s help text.
2020-05-05 13:23:42 +02:00
Roy Ivy III
ab0ef90b4a refact/cat ~ fix style issues 2020-05-04 13:04:02 -05:00
Sylvestre Ledru
6294736d79 Merge branch 'fix-cat' of https://github.com/phungleson/coreutils into phungleson-fix-cat 2020-05-04 13:09:21 +02:00
Sylvestre Ledru
7e3f32d4db style(df): rustfmt src/uu/df/src/df.rs 2020-05-04 10:56:16 +02:00
Sylvestre Ledru
06fe387c76
Merge pull request #1495 from orottier/wc
wc: Do not decode UTF8 when only counting bytes/newlines
2020-05-04 10:54:18 +02:00
Otto Rottier
dab1b9ba1a
rustfmt src/uu/wc/src/wc.rs
Co-authored-by: Sylvestre Ledru <sledru@mozilla.com>
2020-05-04 07:45:30 +02:00
Roy Ivy III
f12c27a57d
Merge pull request #1487 from sylvestre/df-human
refactor and fix some `df` build and cosmetic issues
2020-05-03 15:15:14 -05:00
Roy Ivy III
23b49101c0 fix/df ~ fix build script for sub-crate builds 2020-05-03 14:54:57 -05:00
Roy Ivy III
81d85f398b fix/df ~ missing windows imports 2020-05-03 14:54:57 -05:00
Roy Ivy III
091a356807 fix/df ~ correct number suffix display by using number_prefix PrefixNames::symbol() 2020-05-03 14:53:13 -05:00
Otto Rottier
e3bd6b6848 wc: Do not decode UTF8 when only counting bytes/newlines 2020-05-03 20:39:09 +02:00
Sylvestre Ledru
fc83024ebe refactor(df): use number_prefix like 'ls' instead of doing the display by hand 2020-05-03 13:29:55 -05:00
Sylvestre Ledru
90de33d5d7 maint/df: relax the dependencies 2020-05-03 12:27:55 -05:00
Sylvestre Ledru
850bd9c32d fix(date): fix the date
Date didn't work out of the box.
Refactor it a bit to match other programs
2020-05-03 12:26:17 -05:00
Roy Ivy III
2d5d0680d8 fix(df) ~ fix lint complaint (unused import) 2020-05-03 12:00:42 -05:00
Sylvestre Ledru
8d1f0edfc4 refact(df): follow the same directory pattern than the other software 2020-05-03 11:51:33 -05:00
Sylvestre Ledru
c85756e509 fix(df): Linux: Fix the mount path and type 2020-05-03 11:51:33 -05:00
Sylvestre Ledru
8f6770401d feat(df): Add the support of path for df. ex: df /boot 2020-05-03 11:51:33 -05:00
Sylvestre Ledru
6e8c901204 fix: typo fixes found by codespell 2020-05-01 23:36:33 +02:00
Sylvestre Ledru
2aed7cb035 fix(df): Fix Windows support
- add required handleapi feature for winapi crate
- remove unneeded 'unsafe' section
- remove unused import (GetDiskFreeSpaceExW)
- fix Windows df execution

Co-Authored-By: Roy Ivy III <rivy.dev@gmail.com>
2020-04-28 13:16:19 -05:00
Sylvestre Ledru
f9456e80c3 fix(df): Add support for freebsd 2020-04-28 13:11:22 -05:00
Sylvestre Ledru
8545f03e0f fix(df): Improve MacOSX support 2020-04-28 13:11:21 -05:00
Sylvestre Ledru
dd1a212550 style(df): Fix warnings + cargo fmt
Co-Authored-By: Roy Ivy III <rivy.dev@gmail.com>
2020-04-28 13:11:04 -05:00
Sylvestre Ledru
d5228b5a64 feat(df) add 'df' uutil 2020-04-28 13:05:55 -05:00
Roy Ivy III
5aa2b039a5 change ~ fixup paths (within workspace packages) to common code 2020-04-14 13:46:19 -05:00
Roy Ivy III
78c362c8b5 change ~ fixup paths (within workspace packages) 2020-04-14 13:46:18 -05:00
Roy Ivy III
f0b0e3b867 change ~ reorganize code files 2020-04-14 13:46:18 -05:00